programmatically submitting a form with validation
Posted on 2008-10-16
I have a form, which is sometimes submitted by clicking a submit button, sometimes by enter being pressed in a field, and sometimes programmatically (By the clicking of a "Master Save" elsewhere on the page).
So I created an onsubmit event to do field validation. This works for the first two methods, but breaks for the third. (Ridiculously, the submit() function doesn't trigger onsubmit!)
if (document.getElementById('IFrame1').contentDocumen t.forms.onsubmit())
This works fine in FF, but IE6 is giving me issues. I know, IE6 is ancient, I have no choice, that's the browser the company mandates.
Can anyone suggest why this is breaking, or how else I can call the function in the IFrame?