cesark
01-13-2004, 09:30 AM
Hi !,
Somebody can help me? I have spent hours searching what is the mistake in a ‘.js’ file.
I have two ‘.js’ files with a part of the validation of a form, named ‘Mail.js’ and ‘ZIP.js’, with the functions named ‘checkMail’ and ‘checkZIP’ respectively. Then I have a ‘.js’ file behind of these, named ‘allForm.js’, that trigger both validations. This ‘allForm.js’ file that trigger the two ‘.js’ validations is as follows:
AllForm.js
function valForm1() {
if (!checkMail()) {
return false;
}
if (!checkZIP()) {
return false;
}
return true;
}
The code of the web page:
<head>
<script src="Validations/form1/allForm.js">
</script>
<title>……
…..
<form name="form1_new" onSubmit="return valForm1()" action="……
The ‘Mail.js’ and ‘ZIP.js’ validations runs, but not the ‘allForm.js’. The error that the browser returns when I try to trigger the ‘allForm.js’ is : An object was expected. I can’t understand what is wrong !! :confused:
I have already checked all the ‘returns’ ‘false’ and ‘true’ of the ‘Mail.js’ and ‘ZIP.js’ functions.
Thanks,
Cesar
Somebody can help me? I have spent hours searching what is the mistake in a ‘.js’ file.
I have two ‘.js’ files with a part of the validation of a form, named ‘Mail.js’ and ‘ZIP.js’, with the functions named ‘checkMail’ and ‘checkZIP’ respectively. Then I have a ‘.js’ file behind of these, named ‘allForm.js’, that trigger both validations. This ‘allForm.js’ file that trigger the two ‘.js’ validations is as follows:
AllForm.js
function valForm1() {
if (!checkMail()) {
return false;
}
if (!checkZIP()) {
return false;
}
return true;
}
The code of the web page:
<head>
<script src="Validations/form1/allForm.js">
</script>
<title>……
…..
<form name="form1_new" onSubmit="return valForm1()" action="……
The ‘Mail.js’ and ‘ZIP.js’ validations runs, but not the ‘allForm.js’. The error that the browser returns when I try to trigger the ‘allForm.js’ is : An object was expected. I can’t understand what is wrong !! :confused:
I have already checked all the ‘returns’ ‘false’ and ‘true’ of the ‘Mail.js’ and ‘ZIP.js’ functions.
Thanks,
Cesar