469,626 Members | 1,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

submit two forms with the same button

1
Hello
I would like to know if it is possible submit two html forms with only one button. I am working with JSF and the generated html code has two forms, I have one submit button out these forms and when I click this button I submit the two forms:
function onclick_myButton() {
form1.submit();
form2.submit();
}

but in the java bean of the server i only get one of the forms. why?
Nov 7 '06 #1
1 4116
Hello
I would like to know if it is possible submit two html forms with only one button. I am working with JSF and the generated html code has two forms, I have one submit button out these forms and when I click this button I submit the two forms:
function onclick_myButton() {
form1.submit();
form2.submit();
}

but in the java bean of the server i only get one of the forms. why?
Because by the time the computer submits the second form, its already gone to the "action" page of first form. So the second line will not be executed.

Also, for W3C standards, use document.form1.submit(); and document.form2.submit();
Nov 7 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Margaret Werdermann | last post: by
7 posts views Thread by TJS | last post: by
10 posts views Thread by ljlolel | last post: by
23 posts views Thread by mosesdinakaran | last post: by
6 posts views Thread by yawnmoth | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.