[Javascript] Try to submit a form
Peter Brunone
peter at brunone.com
Tue Jun 18 22:03:01 CDT 2002
Andrew,
I could be wrong, but once you submit a form which targets the current
page, don't you lose control of that page? You might have to aim the form
somewhere else (either another frame or another window).
-Peter
|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Andrew Dunn
|
|Hi there,
|
|I have 5 forms on one page when I try to submit the first form (form[0]),
|it's ok and the form submits, but when I try to submit another form (eg
|form[2]) it doesn't appear that the form does anything and
|certainly doesn't
|put anything in to the database.
|
|Some code is below (see line with ***) the condition on submitting
|a form is
|the visibility of a div, as I have a few div's which appear as tabs.
|
|if (eval("visible_1.style.visibility == 'visible'")) {
| //submit personal info (including notes)
| document.forms[0].submit();
| }
| else if (eval("visible_2.style.visibility == 'visible'")) {
| //submit personal info (including notes)
| document.forms[0].submit();
| }
| else if (eval("visible_3.style.visibility == 'visible'")) {
| alert("enquiry");
| }
| else if (eval("visible_4.style.visibility == 'visible'")) {
| //***
| document.forms[2].submit();
| }
| else if (eval("visible_5.style.visibility == 'visible'")) {
| alert("deposit");
| }
| else if (eval("visible_6.style.visibility == 'visible'")) {
| alert("resident");
| }
|
|Would anyone know why this form would not submit?
|
|Thanks.
|Andrew.
|
More information about the Javascript
mailing list