Answer

Jan 13, 2009 - 03:24 AM
Ok, I learned something new:
The event handler and the onsubmit method are not the same.
What we need to do, instead of called the onsubmit or submit function is to fire an event using different syntaxes for Internet Explorer and Firefox.
Example:
submit_form = function(form)
{
if (document.createEvent) // Firefox etc.
{
event = document.createEvent("HTMLEvents");
event.initEvent("submit", false, true);
form.dispatchEvent(event);
}
else // IE
{
form.fireEvent("onsubmit");
}
}
Note that I am dispatching the "submit" event, not "onsubmit". When submit is about to fire, the onsubmit handler is called first and therefore the scenario still works.
All this has surprisingly little (i.e. nothing) to do with Dojo. Nevertheless I suspect Dojo has a cross browser way to do this hasslefree. I just haven't found it yet.
Thanks for you patience,
Jakob
The event handler and the onsubmit method are not the same.
What we need to do, instead of called the onsubmit or submit function is to fire an event using different syntaxes for Internet Explorer and Firefox.
Example:
submit_form = function(form)
{
if (document.createEvent) // Firefox etc.
{
event = document.createEvent("HTMLEvents");
event.initEvent("submit", false, true);
form.dispatchEvent(event);
}
else // IE
{
form.fireEvent("onsubmit");
}
}
Note that I am dispatching the "submit" event, not "onsubmit". When submit is about to fire, the onsubmit handler is called first and therefore the scenario still works.
All this has surprisingly little (i.e. nothing) to do with Dojo. Nevertheless I suspect Dojo has a cross browser way to do this hasslefree. I just haven't found it yet.
Thanks for you patience,
Jakob
Add New Comment