theform.submit not a function
Posted: Fri Mar 02, 2007 3:48 pm
I've seen this in the forum alot but none of the solutions provided are working so maybe there is a different reason for my error
I have built a form validation script that on a "onsubmit=checkForm() return false;" the script validates the form and submits it on a successful validation
I have used this script over and over on many forms and has worked without flaws
however on this particular form...
1. the html is actually being included via php.
2. there are other javascripts being included (however, no errors are being reported and are not related to the form). This includes some ajax scripting.
the validation function executes as it should as trying to submit an empty form will bring up validation error alerts without script errors. but on successfull validation the debugging in firefox shows a
i did a
and was able to get the name of the form successfully so it cant be that it isnt finding the form.
is there any policy concerning this that needs to be followed? I do not see a reason why there would be such an error if the functions recognises the form
feyd | it's
I have built a form validation script that on a "onsubmit=checkForm() return false;" the script validates the form and submits it on a successful validation
Code: Select all
function checkForm(){
theform = document.forms[0];
// validation
if(!error)
theform.submit();
}
however on this particular form...
1. the html is actually being included via php.
2. there are other javascripts being included (however, no errors are being reported and are not related to the form). This includes some ajax scripting.
the validation function executes as it should as trying to submit an empty form will bring up validation error alerts without script errors. but on successfull validation the debugging in firefox shows a
in the consoletheform.submit is not a function
i did a
Code: Select all
alert(theform.name);
is there any policy concerning this that needs to be followed? I do not see a reason why there would be such an error if the functions recognises the form
feyd | it's
Code: Select all
not [code="..."] :P[/color]