# Need Help Creating a Simple Contact Form with basic validation needed

**URL:** <https://forum.kirupa.com/t/need-help-creating-a-simple-contact-form-with-basic-validation-needed/320726>\
**Category:** Uncategorized\
**Created:** [March 31, 2011, 1:10pm UTC](https://forum.kirupa.com/t/need-help-creating-a-simple-contact-form-with-basic-validation-needed/320726 "2011-03-31T13:10:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisW182](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@ChrisW182](https://forum.kirupa.com/u/ChrisW182)\
**Post date:** [March 31, 2011, 1:10pm UTC](https://forum.kirupa.com/t/need-help-creating-a-simple-contact-form-with-basic-validation-needed/320726/1 "2011-03-31T13:10:34Z")

</div>

I have created a small application with three different slides.

one at frame 1 which acts as a Home page  
one at frame 2 which acts as a Gallery page  
one at frame 3 which acts as a Contact Page

On the contact page i have the following ‘skeleton’ code… which i have to follow…

// button for submitting form  
submitBT.addEventListener(MouseEvent.CLICK, subForm);  
// function used to get data from form  
function subForm (event:Event):void{

contactEmail = getEmail();

trace(“form submitted”);  
}

// validate correct email e.g. contains @  
function getEmail():String{

return emailAddress.text;

}  
stop();

The instance names are as follows

name = person  
email = emailAddress  
message = message

i need basic validation such as text lentgh, and also correct email format (i.e. containing a ‘@’)

please can someone help with this i am pulling my hair out!  
Apologies if it is realyl basic i am brand new to Flash and Actionscript and programming in general.

Chris 🙂
