# Form validation before sending an email

**URL:** <https://forum.kirupa.com/t/form-validation-before-sending-an-email/270439>\
**Category:** flash\
**Created:** [September 9, 2008, 10:55pm UTC](https://forum.kirupa.com/t/form-validation-before-sending-an-email/270439 "2008-09-09T22:55:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakahughes](https://avatars.discourse-cdn.com/v4/letter/y/ee59a6/32.png) [@yakahughes](https://forum.kirupa.com/u/yakahughes)\
**Post date:** [September 9, 2008, 10:55pm UTC](https://forum.kirupa.com/t/form-validation-before-sending-an-email/270439/1 "2008-09-09T22:55:47Z")

</div>

Hey,  
I have a form that users fill out, and it sends me an email. To build this, I use PHP in the way described on a tutorial I found here on [Kirupa.com](http://Kirupa.com):

[http://www.kirupa.com/developer/actionscript/flash\_php\_email.htm](http://www.kirupa.com/developer/actionscript/flash_php_email.htm)

and it works quite well. However, I need to include some type of form validation where if the user fails to fill out certain fields, a text box changes to “ERROR: You must fill out the first 6 fields of the form to submit it.”  
I have tried using a series of If statements on the button before outputting the form vars to the email.php. Can anyone help?
