View Full Version : A form validation

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:


function valForm1() {

if (!checkMail()) {
return false;
if (!checkZIP()) {
return false;
return true;

The code of the web page:

<script src="Validations/form1/allForm.js">


<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.


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

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

to your html page


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

Thank you Alien51,

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum