Hi
I have a button in my movie that when pressed submits 3 pieces of data, name, email and a message.
I would like to be able to check whether the user has actually entered anything and give an error message in a dynamic text box if they have left either input field blank.
Below is the action I have on my button so far. I'm unsure if I have to use If(), and where I would put it.
addButton.onRelease = function() {
myData = new LoadVars();
myData.name = name.text;
myData.email = email.text;
myData.msg = msg.text;
myData.sendAndLoad(" myData, "POST");
name.text = "";
email.text = "";
msg.text = "!Thank You for your message!";
function getVars() {
messages.htmltext = "";
myLoader = new LoadVars();
myloader.ran = random(999);
//again change the next line
myLoader.onLoad = function() {
for (i=0; i<this.n; i++) {
messages.htmltext += "Name: "+"<b>"+this["name"+i]+"</b>"+"<br>"+this["email"+i]+"<br><br>"+this["msg"+i]+"<br>"+" ----------------";
}
};
myLoader.sendAndLoad(" myLoader, "POST");
}
getVars();
};
If anyone could lend a hand I be very grateful!
Thanks
I have a button in my movie that when pressed submits 3 pieces of data, name, email and a message.
I would like to be able to check whether the user has actually entered anything and give an error message in a dynamic text box if they have left either input field blank.
Below is the action I have on my button so far. I'm unsure if I have to use If(), and where I would put it.
addButton.onRelease = function() {
myData = new LoadVars();
myData.name = name.text;
myData.email = email.text;
myData.msg = msg.text;
myData.sendAndLoad(" myData, "POST");
name.text = "";
email.text = "";
msg.text = "!Thank You for your message!";
function getVars() {
messages.htmltext = "";
myLoader = new LoadVars();
myloader.ran = random(999);
//again change the next line
myLoader.onLoad = function() {
for (i=0; i<this.n; i++) {
messages.htmltext += "Name: "+"<b>"+this["name"+i]+"</b>"+"<br>"+this["email"+i]+"<br><br>"+this["msg"+i]+"<br>"+" ----------------";
}
};
myLoader.sendAndLoad(" myLoader, "POST");
}
getVars();
};
If anyone could lend a hand I be very grateful!
Thanks