Hi all,
I have a little function just to check that some boxes of my form have been filled in, and if they have, then submit the form. I keep getting this error though and I can't find out what is wrong with this script, it's probably something simple and I cant see it!
Here is the code:
<script language="JavaScript" type="text/JavaScript">
function subForm(){
message = ""
if (document.existingcustomer.Username.value == ""
{
message += "\n- Username is blank"
}
if (document.existingcustomer.Credit_Card_Number.value == ""
{
message += "\n- Credit Card Number is blank"
}
if (document.existingcustomer.Expiry_Date.value == ""
{
message += "\n- Expiry Date is blank"
}
if (document.existingcustomer.Customer_Password.value == ""
{
message += "\n- Password is blank"
}
if (message != ""
{
alert ("Please correct the following:" + message)
}
else{
document.existingcustomer.action = "bookingconfirmed.php"
document.existingcustomer.method = "post"
document.existingcustomer.submit()
}
}
</script>
And this is the link that calls the function:
<a href="JavaScript:document.existingcustomer.subForm()">confirm my booking</a>
Any ideas? Thanks.
I have a little function just to check that some boxes of my form have been filled in, and if they have, then submit the form. I keep getting this error though and I can't find out what is wrong with this script, it's probably something simple and I cant see it!
Here is the code:
<script language="JavaScript" type="text/JavaScript">
function subForm(){
message = ""
if (document.existingcustomer.Username.value == ""
message += "\n- Username is blank"
}
if (document.existingcustomer.Credit_Card_Number.value == ""
message += "\n- Credit Card Number is blank"
}
if (document.existingcustomer.Expiry_Date.value == ""
message += "\n- Expiry Date is blank"
}
if (document.existingcustomer.Customer_Password.value == ""
message += "\n- Password is blank"
}
if (message != ""
alert ("Please correct the following:" + message)
}
else{
document.existingcustomer.action = "bookingconfirmed.php"
document.existingcustomer.method = "post"
document.existingcustomer.submit()
}
}
</script>
And this is the link that calls the function:
<a href="JavaScript:document.existingcustomer.subForm()">confirm my booking</a>
Any ideas? Thanks.