issue with a form button
the button to call the block.php page doesn't worrk. i've used submits and resets before, but not buttons. so i'm not sure what's wrong here. if anyone can explain it, i would really like to know. it has been edited to prevent horizontal scrolling
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>FindYourDesire.com -- Reading/Sending FYDim</title>
<meta name="Author" content="Pages coded by Josh Perlmutter for
Desired Creations LLC">
<meta name="Author" content="Graphics created by Alix Stolzer for
Desired Creations LLC">
<meta name="Author" content="Smileys created by Amber Beausoleil
for Desired Creations LLC">
<style type="text/css">
<!-- this comment is for non-css compliant browsers
a {text-decoration:none}
end of css -->
</style>
</head>
<body bgcolor="#878787" text="#ffffff" alink="#950c0c" vlink="#3347c5"
link="#000000">
<center> <form action="/findyourdesire/message.php" method="POST"
onReset="window.close();" style="margin:0">
<input type="hidden" name="to" value="Jersey_Girl17">
<table frame="box" bgcolor="#878787" border="1" cellpadding="0"
cellspacing="0" text="#ffffff">
<tr>
<td rowspan="3" width="75" height="75"><a href="profile.php?
un=Jersey_Girl17" target="profile"><img border="0" src="pic.php?
pic=main.Jersey_Girl17.jpg&fn=ltn"></a></td>
<td colspan="2">Message To/From: <a href="profile.php?un=
Jersey_Girl17" target="profile">Jersey_Girl17</a></td>
<td colspan="2"><input type="button" name="block" value=
"Block User" onClick="window.self('block.php');"></td>
</tr>
<tr>
<td colspan="3"></td>
<td ><a href="code.php" target="code">SiteCode</a> On</td>
</tr>
<tr>
<td><input type="submit" value="Send Mail"></td>
<td><input type="reset" value="Close Window"></td>
<td colspan="2"><a name="#desire" href="#desire" onClick=
"window.open('adddesire.php?fun=Jersey_Girl17&fuin=13', 'desire',
'height=196,width=288');">Add Desire</a></td>
</tr>
<tr>
<td colspan="5"><textarea name="message" rows="5" cols="59">
</textarea></td>
</tr>
</table>
</form>
<font size="-2">
<p>Pages coded by Josh Perlmutter for Desired Creations LLC
<br />Graphics created by Alix Stolzer for Desired Creations LLC
<br />Smileys created by Amber Beausoleil for Desired Creations LLC
<br />All creations copyrighted by their respective Creators.
Reproduction Requires Consent of the Creator and Desired Creations LLC.
</p>
</font>
</center>
</body>
</html>
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
druagord posted this at 13:18 — 9th September 2003.
He has: 335 posts
Joined: May 2003
if you don't need to pass variables from this page to the other one then you should use
<input type="button" name="block" value=
"Block User" onClick="window.location='block.php';"></td>
to pass variables you will need to change the action of the form and submit it later
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>FindYourDesire.com -- Reading/Sending FYDim</title>
<meta name="Author" content="Pages coded by Josh Perlmutter for
Desired Creations LLC">
<meta name="Author" content="Graphics created by Alix Stolzer for
Desired Creations LLC">
<meta name="Author" content="Smileys created by Amber Beausoleil
for Desired Creations LLC">
<style type="text/css">
<!-- this comment is for non-css compliant browsers
a {text-decoration:none}
end of css -->
</style>
<script Language="Javascript">
//<!--
function block_user()
{
document.myform.action='block.php';
document.myform.submit();
}
//-->
</script>
</head>
<body bgcolor="#878787" text="#ffffff" alink="#950c0c" vlink="#3347c5"
link="#000000">
<center> <form name="myform" action="/findyourdesire/message.php" method="POST"
onReset="window.close();" style="margin:0">
<input type="hidden" name="to" value="Jersey_Girl17">
<table frame="box" bgcolor="#878787" border="1" cellpadding="0"
cellspacing="0" text="#ffffff">
<tr>
<td rowspan="3" width="75" height="75"><a href="profile.php?
un=Jersey_Girl17" target="profile"><img border="0" src="pic.php?
pic=main.Jersey_Girl17.jpg&fn=ltn"></a></td>
<td colspan="2">Message To/From: <a href="profile.php?un=
Jersey_Girl17" target="profile">Jersey_Girl17</a></td>
<td colspan="2"><input type="button" name="block" value=
"Block User" onClick="block_user();"></td>
</tr>
<tr>
<td colspan="3"></td>
<td ><a href="code.php" target="code">SiteCode</a> On</td>
</tr>
<tr>
<td><input type="submit" value="Send Mail"></td>
<td><input type="reset" value="Close Window"></td>
<td colspan="2"><a name="#desire" href="#desire" onClick=
"window.open('adddesire.php?fun=Jersey_Girl17&fuin=13', 'desire',
'height=196,width=288');">Add Desire</a></td>
</tr>
<tr>
<td colspan="5"><textarea name="message" rows="5" cols="59">
</textarea></td>
</tr>
</table>
</form>
<font size="-2">
<p>Pages coded by Josh Perlmutter for Desired Creations LLC
<br />Graphics created by Alix Stolzer for Desired Creations LLC
<br />Smileys created by Amber Beausoleil for Desired Creations LLC
<br />All creations copyrighted by their respective Creators.
Reproduction Requires Consent of the Creator and Desired Creations LLC.
</p>
</font>
</center>
</body>
</html>
IF , ELSE , WHILE isn't that what life is all about
Suzanne posted this at 13:21 — 9th September 2003.
She has: 5,507 posts
Joined: Feb 2000
Why not just link to it with a hyperlink?
m3rajk posted this at 14:54 — 9th September 2003.
They have: 461 posts
Joined: Jul 2003
good point. no reason i can't change it to a hyperlink. all it needs is the username (to get he user id, which i might pass to it anyway...) and your username and pass which is in a coookie anyway.... hmmmm... probalby the easiest thing to do. i figured using post would obscure it a bit, but there's not reason to stop users form figuring out how to get there directly
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Suzanne posted this at 16:16 — 9th September 2003.
She has: 5,507 posts
Joined: Feb 2000
If you want to use a form to pass the variables, you'd have to have that form separate from the other form, or do weird JavaScript that will be not-cross-os/platform and hence will give you grief.
druagord posted this at 16:19 — 9th September 2003.
He has: 335 posts
Joined: May 2003
the way i did show you will work cross platform/browser without any trouble
Suzanne posted this at 16:29 — 9th September 2003.
She has: 5,507 posts
Joined: Feb 2000
Sorry, druagord, I missed your response! That will work, but only, of course, if JavaScript is enabled (hence not bulletproof). Not necessarily relevant, but to you on xhtml pages, you'd have to make some minor changes.
The above is only a caution. You know me. all about the lurkers.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.