Form Validation

I got a problem. My form Validation isn’t working. Actually to be more accurate, the chEmail function works but I also need Flash to check the input fields “first” and “last” to make sure something is entered in there? Am I missing something here or done something wrong? Thanks peeps

Here’s the code related to the validation

function ckName(){
if (formData.first == “”){
errBox.setMessage(“Oop’s, you forgot to fill in your first name”);
return false; }
else {
return true};
}

function ckName(){
if (formData.last == “”){
errBox.setMessage(“Oop’s, you forgot to fill in your last name”);
return false; }
else {
return true};
}

function ckEmail(){
if(formData.submit_by == “”){
errBox.setMessage(“You Must Fill In Your Email Address”);
return false;}
else{
if(formData.submit_by.indexOf(".",0)==-1 || formData.submit_by.indexOf("@",0)==-1){
errBox.setMessage(“Your Email Address Is Not In Correct Form”);
return false;}
else{
return true;}
}

}

Don’t know if this well help, but instead of saying formData.first == “”, you could try


if(formData.first){
     the good stuff
}else{
     the bad stuff (error message)
}

Saying if(formData.first) will ask if there is anything there (same as nonzero).