Validating A Form

Ok, basically i have an email form that does this:

  • Validates fields if they are not filled in and displays error
  • Sends email if it is filled

But… before i put the validator on, it went to a success message, but now it doesn’t.

All that you do is fill in name, email, telephone and message and click submit and it emails :smiley:

Attached is the FLA, if anyone could explain how and why this wont work id be grateful.

http://www.jasonmayo.co.uk/preview/golpys/booking.fla

Ok heres the code…

Form Movie Clip


onClipEvent(data){
	gotoAndStop(2);
}

Actions Frame

stop();
form.name="";
form.email="";
form.phone="";
form.message="";

Submit Button

on (release) {
	if(form.name == "" ){
		gotoAndStop(3);
	}
	if(form.email == "" ){
		gotoAndStop(3);
	}
	if(form.phone == "" ){
		gotoAndStop(3);
	}
	
	else {
		form.loadVariables("booking_submit.php","POST");
	}
}