Problem with Validating Form

Basically I’ve racked my brain out wondering why Flash isn’t validating my form. It won’t even send to the server for processing. Any help, advice would greatly be appreciated.

[AS]//MY VALIDATION FUNCTIONS
function vEmail(){
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;}
}
}

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

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

function vAddress(){
if (formData.address == “”){
errBox.setMessage(“You must enter a valid Address”);
return false; }
else {
return true};
}

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

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

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

//MY CLEAR ALL INPUT FIELDS FUNCTION FOR MY ‘CLEAR’ BUTTON
function clrData(){
this.formData.submit_by = “”;
this.email.text = “”;
this.formData.first = “”;
this.firstname.text = “”;
this.formData.last = “”;
this.lastname.text = “”;
this.formData.address = “”;
this.address.text = “”;
this.formData.apt= “”;
this.apartment.text = “”;
this.formData.city = “”;
this.city.text = “”;
this.formData.state = “”;
this.state.text = “”;
this.formData.postal = “”;
this.zip.text = “”;
}

//MY REPLY FUNCTION AFTER MESSAGE IS SUCCESSFULLY OR UNSUCCESSFULLY SENT
function myOnLoad(success){
errBox.setEnabled(true);
if(success){
errBox.setIcon(“info”);
errBox.setTitle(“Thank You”);
errBox.setMessage(“Thank You for joining the BCBG mailing list.”);
errBox._visible=true;
clrData();
}
else{
errBox.setIcon(“warning”);
errBox.setTitle(“System Error”);
errBox.setMessage(“Oop’s an error occured while submitting. Please try again.”);
errBox._visible=true;
}
}

//MY SUBMIT FUNCTION TO SEND ALL INFORMATION TO MY SCRIPT SERVER SIDE
function goPostal(){
if(!vEmail()){errBox._visible=true;return;}
else{

if(!vfirstName()){errBox._visible=true;return;}
else{
		
if(!vlastName()){errBox._visible=true;return;)
else{

if(!vAddress()){errBox._visible=true;return;)
else{

if(!vCity()){errBox._visible=true;return;)
else{
					
if(!vState()){errBox._visible=true;return;)
else{
						
if(!vZip()){errBox._visible=true;return;)
	}
}
errBox.setIcon("info");
errBox.setTitle("Sending Mail");
errBox.setMessage("Your Email Is Being Submitted");
errBox._visible=true;
errBox.setEnabled(false);
formData.sendAndLoad("http://max.bcbg.com/js/flashmailscript.php", replyData, "post");

}[/AS]

never mind. :slight_smile: I figured it out. I had to write the if/else statements at the end as “else if” statements. Everything works now.