Hey guys,
I need some help with a college assessment. This is basic stuff, but we have been asked to validate a form with JavaScript before sending it to PHP.
This is my first year with JS so I totally suck at it.
I have this function.
[CODE]
function validate(title, forename, surname, street, town, postcode, email, age)
{
if (title == false)
alert(“Title is blank”)
if (surname == false)
alert(“Surname is blank”)
if (street == false)
alert(“Street is blank”)
if (town == false)
alert(“Town is blank”)
if (postcode == false)
alert(“Postcode is blank”)
if (email == false)
alert(“Email is blank”)
if (age == false)
alert(“Age is blank”)
}
Clearly this is not the way to do things, the function runs but always returns “Title is blank”.
I have no ideas.
Thanks in advance.
Alistair