# On release if variable

**URL:** <https://forum.kirupa.com/t/on-release-if-variable/305005>\
**Category:** Uncategorized\
**Created:** [February 17, 2010, 10:25pm UTC](https://forum.kirupa.com/t/on-release-if-variable/305005 "2010-02-17T22:25:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninjao87](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@ninjao87](https://forum.kirupa.com/u/ninjao87)\
**Post date:** [February 17, 2010, 10:25pm UTC](https://forum.kirupa.com/t/on-release-if-variable/305005/1 "2010-02-17T22:25:22Z")

</div>

Greetings!

I have a small issue with my code… basically I have a contact form…(using the kirupa form tutorial) and I want AS to check if the “email” variable has a value when I press my “submit” button.

If it does then it should do the php post and goto the next frame.

This is what I have so far:

```auto
on (release) {
	if (cform.email = "") {

		cform.email = "Please enter your Email Address!";
	} else {
		cform.loadVariables("contact.php","POST");
	}
	this.nextFrame();
}

```

Currently when I press submit it just goes to the next frame and sends the mail. ☹

Any help would be so appreciated!

Thanks in advance!
