PHP Mail Form in Flash question (neccesary fields)

Just created a Flash PHP Mail Form using the lovely guide from Senocular.

i just have one question - how can i make it so that certain fields MUST be filled out. So if the user does not fill these necccesary fields it takes them to a different part of the timeline where the apropriate message is placed.

thank you guys :p:

say you have a field with var ‘email’ then put smth like

submit.onRelease = function() {
if (email==" ") {
gotoAndPlay(sectionwheremissinginfo)
} else {
// assuming that you have the send function on frame 2
gotoAndPlay(2)
}
}

This is what i have and it doesn’t seem to work

this.form.posljiBtn.onRelease = function() {
	if (ime == "" || rojstvo == "" || naslov == "") {
		gotoAndStop(20);
	} else {
		form.loadVariables("email.php", "POST");
	}
}

ime (name), rojstvo (birth) and naslov (adress) are field vars. I left them blank and it still sent me to the wrong frame, namely the one thanking the user.

i don’t know what could be wrong

the “” doesn’t seem to work here :confused:

there must be something else like maybe null or a way of setting a var or instance with true or false

YEY … I DID IT!!!

i had to create a variable with the same name in the first frame and assign the String type to it.

var ime:String;
var rojstvo:String;
var naslov:String;
var telefon:String;
var email:String;

then when i push the send buttn i assigned the following code:

this.form.posljiBtn.onRelease = function() {
	ime = form.imeTB.text;
	rojstvo = form.rojstvoTB.text;
	naslov = form.naslovTB.text;
	telefon = form.telefonTB.text;
	email = form.emailTB.text;
	if (ime == "" || rojstvo == "" || naslov == "" || telefon == "" || email == "") {
		gotoAndStop(20);
	} else {
		form.loadVariables("email.php", "POST");
	}
}

ime, rojstvo, naslov, telefon and email are the variables ane the imeTB, rojstvoTB, naslovTB, telefonTB and emailTB are the instance labels.

maybe it’s a bit crappy splution but it’s the only one i can think of (spent almost 2 whole **** hours trying to make it work) :sleep:

if you guys have a better idea let me know!! :afro: