Sunday, November 29, 2009

IE and PHP forms?

In Internet Explorer my form is not being submitted, but it works in Firefox, whats wrong?



Form:



%26lt;form action="%26lt;?php echo $_SERVER['PHP_SELF']; ?%26gt;" method="post"%26gt;



First Name:%26lt;input type="text" name="name" size="20" maxlength="20" value="%26lt;?php if (isset($_POST['name']))?%26gt;" /%26gt;



%26lt;input type="image" src="images/submit_btn.png" name = "submit" value="submit" alt="submit"%26gt;



%26lt;/form%26gt;



Handler:



if (isset($_POST['submit'])) { // Handle the form.



echo 'form submitted';



}



IE and PHP forms?microsoft flight simulator





Try changing the Submit button to a regular submit, instead of an image. I've always had problems with image submit buttons.



%26lt;input type="submit" name = "submit" value="submit" /%26gt;



If that's not the problem, then I'll look for something else.



IE and PHP forms?windows 2000 internet explorer



I've noticed in IE, when you have an image as the submit button and you hit 'enter' instead of clicking on the button to submit the form, it will not send the value of the submit button in the post array. Try adding a hidden input field to send that 'submit':



%26lt;input type="hidden" name="submitted" value="yes" /%26gt;



That should work if you change your if statement to:



if($_POST["submitted"] == "yes") { //Handle the form. ...etc

No comments:

Post a Comment

 
shared web hosting