# Checking a variable

**URL:** https://forum.kirupa.com/t/checking-a-variable/240568
**Category:** Uncategorized
**Created:** [October 4, 2007, 2:21am UTC](https://forum.kirupa.com/t/checking-a-variable/240568 "2007-10-04T02:21:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ultra](https://avatars.discourse-cdn.com/v4/letter/u/a587f6/32.png) [@Ultra](https://forum.kirupa.com/u/Ultra)
#### Post date: [October 4, 2007, 2:21am UTC](https://forum.kirupa.com/t/checking-a-variable/240568/1 "2007-10-04T02:21:37Z")

</div>

Hi,

I’ve created a php email form which works fine, and I have action script attached on the ‘submit’ button which checks for certain values in the input fields…

There are only 3 input fields:

1. Name field - variable assigned = ‘name\_input’ - Input text / single line
2. email field - variable assigned = ‘email’ - Input text / single line
3. Message field - variable assigned = ‘message\_input’ - Input text / multi line

All input text field are located in a movieclip called ‘form’.

Now, on the send button i check if certain criteria is met…

```auto
on(release){
	if ((_parent.form.name_input.length<1) or (_parent.form.message_input.length<1)) {
		_parent.error_message.gotoAndPlay("s1");
	}
	else{
		_parent.form.loadVariables("email.php", "POST");
	}
}

```

–\> I cut this code down a little bit because the rest of the code works but those two conditions are just not checked by flash…

Even if I leave both the Name and Message field empty it will still send the message and not (as it should) go and play the error message…

What am I doing wrong here ?

As always, thanx for your help and advise in advance !

Mike
