hmmmm
Ok this is my setup:
I have this in my head tag - this sets fields to values if they are empty:
function onSubmit(form)
{
if(form.xTitler.value==')
{
form.xTitler.value = form.Title.value;
form.xFirstNamer.value = form.FirstName.value;
form.xSecondNamer.value = form.SecondName.value;
form.xHouseNumberr.value = form.HouseNumber.value;
form.xStreet1r.value = form.Street1.value;
form.xTownCityr.value = form.TownCity.value;
form.xWootr.value = form.PostCoder.value;
form.xSwootr.value = form.County.value;
}
}
I have this near the bottom of the page which validates the form:
function checkform(theform)
{
trimall(theform);
theControl="Title,FirstName,SecondName,HouseNumber,Street1,TownCity,
County,PostCoder,cardholdersname,cardnumber,cv2,cardholdersemail";
theMessage="title,first name,second name,house number,street,town or city,county,post code,name of card holder,credit card number,3 digit security number,email address";
theNumeric=",,,,,,,,,,,,,,,,,,,";
theEmail=",,,,,,,,,,,,,,,,,,,";
theURL=",,,,,,,,,,,,,,,,,,,"
theConfirmPassword=",,,,,,,,,,,,,,,,,,,";
thebadstuff=",,,,,,,,,,,,,,,,,,,";
theinteger=",,,,,,,,,,,,,,,,,,,";
thepercent=",,,,,,,,,,,,,,,,,,,";
thesize=",,,,,,,,,,,,,,,,,,,";
thedecimal=",,,,,,,,,,,,,,,,,,,";
theimage=",,,,,,,,,,,,,,,,,,,";
theempty="Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y";
themin=",,,,,,,,,,,,,,,,,,,";
themax=",,,,,,,,,,,,,,,,,,,";
thecheckboxlength=",,,,,,,,,,,,,,,,,,,";
thephoneno=",,,,,,,,,,,,,,,,,,,";
if(!theValidator(theform,theControl,theMessage,theNumeric,theEmail,
theURL,theConfirmPassword,thebadstuff,theinteger,thepercent,thesize,
thedecimal,theimage,theempty,themin,themax,thecheckboxlength,thephoneno))
return false;
return true;
}
</SCRIPT>
As I said before, if I call them individually in the form tag using onsubmit they are fine but together they both die. Whether it be onsubmit="onSubmit(this); return checkform(this);"
or
onsubmit="return(onSubmit(this) && checkform(this));"
any ideas? this is killing me...i am not a javascript expert in any way
thanks