SharkBait Posted April 14, 2008 Share Posted April 14, 2008 Am I allowed to have multiple forms on a single web page? <form action="search.php" name="meh" method="post"> <input type="text" name="name" /> <input type="submit" name="newname" value="Lookup"/> </form> <p>Some stuff here</p> <form action="<?php $_SERVER['PHP_SELF'];?>" method="post" name="blah"> <input type="text" name="address" /> <input type="submit" name="newaddress" value="Go" /> </form> With Firefox it works fine. I click on the 'Go' button and the page POSTs into itself. But with IE it will POST into the search.php page which is what I don't want. Am i doing something wrong? Or is IE truely retarded? I find Firefox to be more forgiving when there are little issues with HTML etc. Quote Link to comment https://forums.phpfreaks.com/topic/101070-solved-multiple-html-forms-on-1-page/ Share on other sites More sharing options...
rhodesa Posted April 14, 2008 Share Posted April 14, 2008 The posted code was tested in IE6 on WinXP and worked fine. I am not currently at a computer where I can test IE7. What Version of IE is giving you the issue? Quote Link to comment https://forums.phpfreaks.com/topic/101070-solved-multiple-html-forms-on-1-page/#findComment-516892 Share on other sites More sharing options...
SharkBait Posted April 14, 2008 Author Share Posted April 14, 2008 IE 6. Unless I have some weird tag issues happening. (perhaps not a closed tag somewhere?) I am thinking it could be a tag issue because Firefox seems to understand what you're trying to do if things aren't perfect, where as IE freaks out and dies. lol Both forms in the page have opening and closing <form></form> tags. Quote Link to comment https://forums.phpfreaks.com/topic/101070-solved-multiple-html-forms-on-1-page/#findComment-516905 Share on other sites More sharing options...
SharkBait Posted April 14, 2008 Author Share Posted April 14, 2008 I found what it was. There was a residual </td> tag sitting next to one of the <input /> tags. I removed it and now IE is smart enough to submit to the proper page. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/101070-solved-multiple-html-forms-on-1-page/#findComment-516914 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.