# PHP Mail Form in Flash question (neccesary fields)

**URL:** <https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112>\
**Category:** flash\
**Created:** [October 2, 2004, 6:43pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112 "2004-10-02T18:43:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShulChi](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@ShulChi](https://forum.kirupa.com/u/ShulChi)\
**Post date:** [October 2, 2004, 6:43pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112/1 "2004-10-02T18:43:42Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 9:30pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112/2 "2004-10-02T21:30:48Z")

</div>

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)  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 11:23pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112/3 "2004-10-02T23:23:50Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 1:04pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112/4 "2004-10-03T13:04:23Z")

</div>

the “” doesn’t seem to work here 😕

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 2:05pm UTC](https://forum.kirupa.com/t/php-mail-form-in-flash-question-neccesary-fields/66112/5 "2004-10-03T14:05:26Z")

</div>

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.

```auto
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:

```auto
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:
