Help on form validation please :-)

Hi,

I was hoping someone might be able to shed light on a newb kinda question.

I have a contact form that validates. The fields in the form are NAME, TELEPHONE, EMAIL and DATE.

I have it set up so if anything is left blank it will stop the operation (stop immediate propagation) but I would now like it to only stop if TELEPHONE or EMAIL is left blank. So if someone fills it all in except TELEPHONE it will still send. Or if they fill everything out except EMAIL it will send. But if they leave both TELEPHONE and EMAIL blank, it will stop the whole process.

Bellow is my current validation in AS3:

//validator
if (name_txt.text.length<=0 || phone_txt.text.length<=0 || subject_txt.text.length<=0 || note_txt.text.length<=0)
{
e.stopImmediatePropagation( );
feedback_txt.text = “Error- No se pueden dejar espacios en blanco.”;
} else {
feedback_txt.text = “Ufff, ya hueles a carro nuevo.”;
mailAddress.data = variables;
mailAddress.method = URLRequestMethod.POST;
sendToURL(mailAddress);
}

Help would be greatly appreciated :slight_smile:

Thanks,
CB