Question
Emial Form Trouble
Hi All!
I am trying to get my validation scripting for my emial form to work, but with no success. I have 4 input fields - name, email, contact and message. Then I have an dynamic text box which displays the "validations" called info. The scripting on my submit button is as follows:
on (press, release) {
//
if (name == "") {
nameValid = false;
}
if (email == "") {
emailValid = false;
}
if (contact == "") {
contactValid = false;
}
if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
emailValid = false;
}
if (message == "") {
messageValid = false;
}
//
if (nameValid && emailValid && contactValid && messageValid) {
loadVariables("contact.php",'GET');
message="";
name="";
email="";
contact="";
info="Thank you, I will contact you shortly.";
} else {
if (!nameValid) {
info = "Please enter your Name and Surname";
} else if (!emailValid) {
info = "Please enter a valid Email address";
} else if (!contactValid) {
info = "Please enter your Contact number";
} else if (!messageValid) {
info = "Please enter your message.";
}
}
}
Any help will be appreciated.
Kind Regards
Esmarilda
I am trying to get my validation scripting for my emial form to work, but with no success. I have 4 input fields - name, email, contact and message. Then I have an dynamic text box which displays the "validations" called info. The scripting on my submit button is as follows:
on (press, release) {
//
if (name == "") {
nameValid = false;
}
if (email == "") {
emailValid = false;
}
if (contact == "") {
contactValid = false;
}
if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
emailValid = false;
}
if (message == "") {
messageValid = false;
}
//
if (nameValid && emailValid && contactValid && messageValid) {
loadVariables("contact.php",'GET');
message="";
name="";
email="";
contact="";
info="Thank you, I will contact you shortly.";
} else {
if (!nameValid) {
info = "Please enter your Name and Surname";
} else if (!emailValid) {
info = "Please enter a valid Email address";
} else if (!contactValid) {
info = "Please enter your Contact number";
} else if (!messageValid) {
info = "Please enter your message.";
}
}
}
Any help will be appreciated.
Kind Regards
Esmarilda