Forum Moderators: open
The classic event registeration mechanism works fine, since we can just write:
formObj.onsubmit = anEvent;
formObj.anEvent();
1) fire the event which would trigger the function call
2) call the function directly
So, in your example:
formObj.onsubmit = anEvent; 1)
formObj.submit(); anEvent(); Both would cause the specified function to be run. The difference is just whether you actually want the form submission (or link click, or whatever else events you are capturing) to actually take place or not.