This is my first time doing an FLASH form validation and I’m new to FLASH.
I have the follow Actions: (AS 2.0)
bSubmit.onRelease = function()
{
valiForm();
}
function valiForm()
{
var sMessage = "Name: " + tName.text + "\nE-mail: " + tEmail.text + "\nPhone: " + tPhone.text;
lvSend = new LoadVars();
lvReply = new LoadVars();
var thanks = "Thanks " + tName.text + "your message has been sent";
lvSend.msg = sMessage;
lvSend.address = "myemail@ex.ex";
tName.text = "";
tEmail.text = "";
tPhone.text = "";
lvReply.onLoad()
{
tDone.text = thanks;
}
lvSend.sendAndLoad('/templates/t3976/mail.php', lvReply, 'POST');
}
now before I send the form I want to check if the tName field is empty if it is alert of some way and if it’s good then submit the form. also I want do to the same for the nPhone field.
thanks for the help and sorry for my bas english.
the simplest way is to compare String in IF
in your case that would be