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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.