Bizzare form problem - Please Help!
| From: | Paul | Date: | Tue, 06 Jan 2004 22:56:52 +0000 |
| Subject: | Bizzare form problem - Please Help! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173924@lists.php.net to get a copy of this message | ||
Sorry if this is a repost, I could not see the original.
Any help with this would be immensely appreciated!
Here is what the problem I am having is:
I have a .php page. There are several form fields. When I populate the
fields, submit to another page, and then use the browser's back button, the
data is still there. This is indeed what I want.
HOWEVER, when one field has a javascript event (ie. onClick open a browser
window) when I submit the form, and try to go back, the data is gone :(
If I use the exact same page without a php extension, things are still fine.
Unfortunately I need
this to be a PHP as I will be linking dynamic data to drop down lists.
This seems bizarre to me. Following is a very simple sample. Served as an
.html file it is just fine, served as a .php file the form data is lost on a
back click.
Thanks for any help!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript">
<!--
function openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<form name="form1" id="form1" method="post" action="http://www.cnn.com">
<table width="400" border="1">
<tr>
<td width="92">One</td>
<td width="292">
<input name="textfield1" type="text" id="textfield1" />
</td>
</tr>
<tr>
<td>Two</td>
<td><input name="textfield2" type="text"
id="textfield2" /></td>
</tr>
<tr>
<td>Three</td>
<td><input name="textfield3" type="text"
id="textfield3"
onclick="openBrWindow('http://www.cnn.com','','width=50,height=50')"
/></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"
/></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>