Current time: 04-16-2014, 11:57 AM Hello There, Guest! (LoginRegister)

Post Reply 
Multiple Post Forms on One Page...PHP
12-19-2006, 10:16 PM
Post: #1
Multiple Post Forms on One Page...PHP
Can you set up multiple POST forms on the same page? I have a search field that I use in the header file of my shopping cart, on the main file I also have the item detail with another form to do the checkout. Currently when I post to the search form, it's submitting the other form too.

Any bright ideas on a workaround? Or did I just goof something up in the code? Help would be appreciated.

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com
Visit this user's website Find all posts by this user
Quote this message in a reply
12-19-2006, 10:52 PM
Post: #2
Multiple Post Forms on One Page...PHP
Make sure that you have completely isolated the forms and didn't accidentally include the second one before the closing form tag of your first form. Multiple forms on one page is a very common thing to do.

If that doesn't do it, take a look at your forms and make sure they have different names and ids. A submit button only applies to the form that contains it. Another technique is to call a js function based on user input, which will grab the appropriate form using getElementById() and submit that.
Find all posts by this user
Quote this message in a reply
01-02-2007, 02:15 PM
Post: #3
Multiple Post Forms on One Page...PHP
Thanks!

As it turns out, this was due to sloppy html on my part. DUH!

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: