...

View Full Version : A form validation



cesark
01-13-2004, 10: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

A1ien51
01-13-2004, 03:22 PM
you most likely need to add

<script src="Validations/form1/Mail.js">
</script>
<script src="Validations/form1/Zip.js">
</script>

to your html page

Eric

cesark
01-13-2004, 04:15 PM
:thumbsup: You are right !

Thank you Alien51,
Cesar



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum