PDA

View Full Version : Form Submissions


patb96
05-19-2005, 03:14 PM
I'm relatively new w/ javascript but i have a page with a form and a link in which i want to submit a the form on click however it is not working. can someone please tell me what i might be doing wrong

attached code
<a href="#" onClick="document.event_form.submit()">Test</a>

i have another page with the exact same code and it works. Please help i am completely lost.

delinear
05-19-2005, 04:30 PM
Try putting in a return false statement:

<a href="#" onClick="document.event_form.submit(); return false;">Test</a>

If that doesn't work, make sure that the form is actually called "event_form" - also make sure there are no other elements in the page called "event_form", even if it's not a form it can still stop the javascript working. Usually that's the culprit.

Kor
05-19-2005, 05:06 PM
document.forms['event_form'].submit()