# Form validation

**URL:** https://forum.kirupa.com/t/form-validation/203650
**Category:** Uncategorized
**Created:** [October 12, 2006, 8:21pm UTC](https://forum.kirupa.com/t/form-validation/203650 "2006-10-12T20:21:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![htrain26](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@htrain26](https://forum.kirupa.com/u/htrain26)
#### Post date: [October 12, 2006, 8:21pm UTC](https://forum.kirupa.com/t/form-validation/203650/1 "2006-10-12T20:21:49Z")

</div>

hi (again), I finally found a tutorial on how to get a form with checkboxes to work–but, I’m trying to make it where all the feilds have to be filled out before you can submit it. I just don’t know what to put in this area.

here is the code–the problem is down at the bottom—

mc=this;  
tfA=[“company”, “contact”, “address”, “city”, “state”, “zip”, “phone”, “email”, “addinfo”];  
cbA=[“individual”, “group”, “medicare”, “prescription”, “life”, “annuities”, “longterm”];  
submit\_btn.onPress=function(){  
lv=new LoadVars();  
for(var i=0;i\<tfA.length;i++){  
lv[tfA\*]=mc[tfA\*].text;  
}  
for(var j=0;j\<cbA.length;j++){  
lv[cbA[j]]=mc[cbA[j]].selected;  
}  
lv.sendAndLoad(“email\_request1.php”,lv,“POST”);  
}

submit\_btn.onRelease = function(){  
//I just don’t know what to put after the if statment, I tried just the instance  
names-no luck.  
if ( “”){  
\_root.gotoAndPlay(“error”);  
} else {  
\_root.gotoAndPlay(“correct”);  
}  
}

any suggestions?

thanks,  
hutch
