Tuesday, April 23, 2013

javascript submit is not a function

Javascript:
When you try to call submit() from javascript like the one below,
function addRule() {
var ff=document.forms["testForm"];
ff.wizardAction.value="ADD";
ff.submit();
}

Error Message:
submit is not a function

Resolution:
It means that you named your submit button or some other element submit. Rename such button(s) to some other name and your call will magically work.

When you name the button submit, you override the submit() function on the form.

No comments:

Post a Comment