Jump to content

Multiple Forms


kreut

Recommended Posts

Hello!

 

I've got several forms on one page that use the same variable names for input values.  (Say, form1, form2, and form3).  I'm using javascript to show only one of the forms based on a selection (say British, American, Canadian).  How can I write  code which will tell the page to ONLY look at the variables from a particular form when I hit the submit button for one of the forms?

 

Thanks so much....

Link to comment
https://forums.phpfreaks.com/topic/228397-multiple-forms/
Share on other sites

Yep, if you had say:

 

<form action="somepage.php" method="post">
   <input type="text" name="english_somthing" />
   <input type="submit" name="submit_english" />
</form>

<form action="somepage.php" method="post">
   <input type="text" name="spanish_somthing" />
   <input type="submit" name="submit_spanish" />
</form>

 

If you were to press submit one the English form, only the input from that form, not the Spanish, would be passed.

Link to comment
https://forums.phpfreaks.com/topic/228397-multiple-forms/#findComment-1177694
Share on other sites

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.