却发现并没有触发form的
onsubmit方法,而是直接提交了。奇怪了,难道没有这种方式无法结合form的
onsubmit方法吗?
仔细想了想,既然this.form表示form这个对象,那么肯定能获取到form的属性和方法的
,就改成this.form.
onsubmit(); 成功!
我又查了查手册,原来
submit的方法是这样解释的:
The
submit method does not invoke the
onsubmit event handler. Call the
onsubmit event handler directly. When using Microsoft® Internet Explorer 5.5 and later, you can call the fireEvent method with a value of
onsubmit in the sEvent parameter.