Jump to content

[SOLVED] Multiple HTML forms on 1 page


SharkBait

Recommended Posts

 

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/101070-solved-multiple-html-forms-on-1-page/
Share on other sites

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.