mailform is a php file. When i use the following script on the root it works.
When it is inside another clip it doesn’t. Anyone know why?
loadVariablesNum(mailform, 0);
answer = confirm;
Here is the total script:
fscommand (“allowscale”, “false”);
fname1.tabIndex = 1;
telno1.tabIndex = 2;
pcode1.tabIndex = 3;
email1.tabIndex = 4;
hear1.tabIndex= 5;
comments1.tabIndex = 6;
mailform = “mailform.php”;
confirm = “please wait for confirmation …”
action = “send”;
Selection.setFocus(“fname”);
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == “ERROR! Address not valid”)) {
email = “ERROR! Address not valid”;
action = “”;
}
if (!validate(email)) {
email = “Address not valid”;
action = “”;
}
if ((((fname == null)) || (fname.length<1)) || (fname == “ERROR! Address not valid”)) {
fname = “Name required”;
action = “”;
}
if ((((pcode == null)) || (pcode.length<1)) || (pcode == “ERROR! Postcode not valid”)) {
pcode = “Postcode”;
action = “”;
}
if ((validate(email)) && (email != “ERROR!”) && (fname != “”) && (lname != “”)) {
action = “send”;
loadVariablesNum (mailform, 0, “POST”);
gotoAndPlay (“wait”);
}
if ((((hear == null)) || (hear.length<1)) || (hear == "ERROR! Entry not valid")) {
hear = "Input here";
action = "";
}
if ((((telno == null)) || (telno.length<1)) || (telno == "ERROR! Phone number not valid")) {
telno = "Phone Number required";
action = "";
}
}
stop ();