# Check box in form w/validation problems.PLS HELP!

**URL:** <https://forum.kirupa.com/t/check-box-in-form-w-validation-problems-pls-help/209439>\
**Category:** Uncategorized\
**Created:** [December 8, 2006, 8:31pm UTC](https://forum.kirupa.com/t/check-box-in-form-w-validation-problems-pls-help/209439 "2006-12-08T20:31:03Z")\
**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:** [December 8, 2006, 8:31pm UTC](https://forum.kirupa.com/t/check-box-in-form-w-validation-problems-pls-help/209439/1 "2006-12-08T20:31:03Z")

</div>

hello there, I am under a major, major Deadline!  
I have a flash and php contact form with a validation made with all input text boxes. I need to add 1 check box to the form, but I don’t know how to pass it to through.

here is the code I have for my form now.

function checkForm():Boolean {  
// this checks whether required fields have been filled in  
// initialize missing flag on assumption everything OK  
var missing:Boolean = false;  
// clear all error text fields  
error1\_txt.text = error2\_txt.text=error3\_txt.text="";  
// check each field  
// if problem is encountered, display message  
// and set missing flag to true  
if (text\_field\_1.text == “”) {  
error1\_txt.text = “Please enter your name”;  
missing = true;  
}  
if (text\_field\_2.text.indexOf("@") == -1) {  
error2\_txt.text = “Please enter a valid email address”;  
missing = true;  
}  
if (text\_field\_5.text == “”) {  
error3\_txt.text = “You have not entered any comments”;  
missing = true;  
}  
// if missing is true, return false  
// otherwise return true  
return missing ? false : true;  
}  
function sendMessage():Void {  
// check whether form has been correctly filled in  
var formOK:Boolean = checkForm();  
// if no problems, process the form and send variables to PHP script  
if (formOK) {  
// Form processing goes here  
message.from = text\_field\_1.text;  
message.email = text\_field\_2.text;  
message.comments = text\_field\_5.text;  
message.sendAndLoad(“feedback.php?ck=”+ new Date().getTime(), messageSent);  
// display message informing user that email is being sent  
gotoAndStop(“sending”);  
}  
}  
function backToForm():Void {  
// send playhead back to the main form  
gotoAndStop(“theForm”);  
}  
// create and apply text format for date  
var dateDisplay:TextFormat = new TextFormat();  
dateDisplay.font = “Georgia,Times,\_serif”;  
theDate\_txt.setNewTextFormat(dateDisplay);  
theDate\_txt.autoSize = “left”;  
// create LoadVars instance to retrieve date from PHP script  
var getDate:LoadVars = new LoadVars();  
// initialize LoadVars to send form data  
// and receive response from the PHP script  
var message:LoadVars = new LoadVars();  
var messageSent:LoadVars = new LoadVars();  
// load date from PHP  
getDate.load(“[http://localhost/phpflash/ch02/today2.php](http://localhost/phpflash/ch02/today2.php)”);  
// assign theDate property of the LoadVars instance to text field  
getDate.onLoad = function() {  
theDate\_txt.text = this.theDate;  
};  
messageSent.onLoad = function() {  
if (this.sent == “OK”) {  
gotoAndStop(“acknowledge”);  
} else {  
gotoAndStop(“failure”);  
failure\_txt.text = this.reason;  
}

};  
gotoAndStop(“theForm”);

any help would be greatly appreciated.  
thanks,  
hutch
