faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

40 of 54 people (74%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Why does the onSubmit event not get triggered in my form with NN?

Aug 27th, 2000 05:05
Martin Honnen, Helen Pownall, Nathan Wallace,


A FORM's onsubmit event doesn't get fired when you submit a form with 
JavaScript e.g.
  document.formName.submit()
That is the same for NN and IE. I don't know of any other case when 
onsubmit is not fired in NN. 
If you want onsubmit to be called before submitting with JavaScript you 
can explicitly call it in NN and IE with:
  if (document.formName.onsubmit())
    document.formName.submit();