Hey Everyone
I need some help with a form i'm creating
in KeyFrame 1a i have
Code:
------------------------------------------------------------
function ckName() {
if (formData.name == "") {
errBox.setMessage("You Must Fill In Your Name");
return false;
} else {
return true;
}
}
function ckAddress() {
if (formData.address == "") {
errBox.setMessage("You Must Fill In Your Address");
return false;
} else {
return true;
}
}
function ckPhone() {
if (formData.phone == "") {
errBox.setMessage("You Must Give Us A Contact Number");
return false;
} else {
return true;
}
}
function ckEmail() {
if (formData.email == "") {
errBox.setMessage("You Must Fill In Your Email");
return false;
} else {
if (formData.email.indexOf(".", 0) == -1 || formData.email.indexOf("@", 0) == -1) {
errBox.setMessage("You Email Address is Not Correct");
return false;
} else {
return true;
}
}
}
function clrData() {
this.formData.name = "";
this.nameIN.text = "";
this.formData.address = "";
this.addressIN.text = "";
this.formData.phone = "";
this.phoneIN.text = "";
this.formData.email = "";
this.emailIN.text = "";
this.formData.comments = "";
this.commentsIN.text = "";
this.formData.type_of_party = "";
this.typeIN.??????????
}
function myOnLoad(success) {
errBox.setEnabled(true);
if (success) {
errBox.setIcon("info");
errBox.setTitle("Thankyou");
errBox.setMessage("Thankyou For Inquring With Us. You Will Be Contacted Soon");
errBox._visible = true;
clrData();
} else {
errBox.setIcon("warning");
errBox.setTitle("System Error");
errBox.setMessage("There Has Been A Problem Submiting Your Information Please Try Again");
errBox._visible = true;
}
}
function goPostal() {
if (!ckName()) {
errBox._visible = true;
return;
} else {
if (!ckEmail()) {
errBox._visible = true;
return;
} else {
if (!ckPhone()) {
errBox._visible = true;
return;
} else {
if (!ckAddress()) {
errBox._visible = true;
return;
}
}
}
errBox.setIcon("info");
errBox.setTitle("Sending Information");
errBox.setMessage("Thankyou For Inquring With Us. You Will Be Contacted Soon");
errBox._visible = true;
errBox.setEnabled = (false);
formData.sendAndLoad("Http://address/cgi-bin/name.cgi", replyData, "post");
}
}
------------------------------------------------------------
Like so
In key frame 1b (not sure if u need to see it, but here it is)
Code:
------------------------------------------------------------
formData = new LoadVars();
formData.name = "";
formData.address = "";
formData.phone = "";
formData.email = "";
formData.comments = "";
formData.type_of_party = "";
replyData = new LoadVars();
replyData.onLoad = myOnLoad;
------------------------------------------------------------
Most of it is pritty simple... here are some of the things that might not understand
clrData is the handler for then u clear the form
goPostal is the handler for when u press submit
errbox is a message box
Now to the problem
i have a selection box type_of_party
with a handler name of formData.type_of_party
and a instance name of typeIN
I want it so that when you click resest it resests this selection box to the default. and also when u click sumbit it acctually ssends something.
can anyone help me with this. if u need a bit more info just give me a email
Regards