I am new to javasacript and need some help please.
How do I change the code so that it checks if the postcode is not a number, using the isNaN function?
//function to check fields
function Blank_TextField_Validator(form)
{
// check empty name field
if (form.Name.value == "")
{
alert("Please fill in the Name field");
form.Name.focus();
return (false);
}
//check empty address field
if (form.Address.value == "")
{
alert("Please fill in the Address field");
form.Address.focus();
return (false);
}
//check empty suburb field
if (form.Suburb.value == "")
{
alert("Please fill in the Suburb field");
form.Suburb.focus();
return (false);
}
//check empty postcode field
if (form.Postcode.value == "")
{
alert("Please fill in the Postcode field");
form.Postcode.focus();
return (false);
}
//check postcode four number length
if (form.Postcode.value.length !=4)
{
alert("Your Postcode must contain four numbers.");
form.Postcode.focus();
return (false);
}
return (true);
}