Can I have multiple forms on a page but only have one submit button that posts the input of all forms? If so how do I do it. Will it matter if some of the forms are not displayed when others are?
No, I don't think you can have one submit type for different forms. But you can set up a function by JavaScript to put parameters from different forms into one single URL
function tosend() {
a=document.firstform.fieldone.value;
b=document.secondform.fieldtwo.value;
blah,blah,blah
document.location.href="anotherpage.htm?form1value="+a+"form2value="+b+.....
}
You might need to find the number of forms from the page first and generate a loop instead of hard code the forms' properties.
What you can do, depending on what you really want to do is make one really big form. So that the form tag runns from the top of the page to the bottom. Doing this you will then be able to offer one submit button which will work for the page and you can then add form elements all over the page. This is the only way to get around this using HTML?
Hope this helps - even if you did have one button for say two forms the information from the forms would be done in the same action!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.