# Forms validation or check up issues

**URL:** <https://forum.kirupa.com/t/forms-validation-or-check-up-issues/300516>\
**Category:** flash\
**Created:** [November 23, 2009, 3:42am UTC](https://forum.kirupa.com/t/forms-validation-or-check-up-issues/300516 "2009-11-23T03:42:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thevibe](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@thevibe](https://forum.kirupa.com/u/thevibe)\
**Post date:** [November 23, 2009, 3:42am UTC](https://forum.kirupa.com/t/forms-validation-or-check-up-issues/300516/1 "2009-11-23T03:42:23Z")

</div>

Hi Guys,

I am doing some forms in Flash Cs4 with AS3. The forms are working well, but i have a code to check if people have enter information in every field. But the verification only works for 2 field. The code is exactly the same for the other but it doesn’t work. Can you double check my code and maybe explain me why it doesn’t work or maybe how to replace the validation code by another.

The validation works only for the LastName data and Email field.

Here’s the code;

submit\_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);

function ValidateAndSend(event:MouseEvent):void{

//validate form fields  
if(!txtContactFirstName.length) {  
status\_txt.text = “\*Please enter your first name.”;   
} else if(!txtContactEmail.length) {  
status\_txt.text = “\*Please enter an email address”;  
} else if(!validateEmail(txtContactEmail.text)) {  
status\_txt.text = “\*Please enter a VALID email address”;  
} else if(!txtAccountCity.length) {  
status\_txt.text = “\*Please enter a city.”;  
} else if(!txtContactLastName.length) {  
status\_txt.text = “\*Please enter your last name”;  
} else {

status\_txt.text = "Thanks " + txtContactFirstName.text + “your information has been sent!”;

Thanks guys
