# Needs a Checkbox script for a contact form

**URL:** <https://forum.kirupa.com/t/needs-a-checkbox-script-for-a-contact-form/300653>\
**Category:** flash\
**Created:** [November 25, 2009, 5:37am UTC](https://forum.kirupa.com/t/needs-a-checkbox-script-for-a-contact-form/300653 "2009-11-25T05:37:05Z")\
**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 25, 2009, 5:37am UTC](https://forum.kirupa.com/t/needs-a-checkbox-script-for-a-contact-form/300653/1 "2009-11-25T05:37:05Z")

</div>

Hi guys,

I am converting an html form to a flash form. I am not so good with AS3 and it’s the first time I have to create forms so it was quite difficult for me. I am almost done, I did the text fields and the comboboxes, so everything except the checkboxes works. I don’t find any specific tutorial that really explain me how to script it to work like the html form does. I am sure it’s quite simple for an advance AS3 user, so please help me with this. Please try to work with what I already did to be sure I can incorporate the new script with what I did.

Here’s the html code for the 5 checkboxes;

…\<input type=“checkbox” name=“txtMessage” value=“Find Your Pace”\>…  
…\<input type=“checkbox” name=“txtMessage” value=“Stress Escape”\>…  
…\<input type=“checkbox” name=“txtMessage” value=“Time Revolution”\>…  
…\<input type=“checkbox” name=“txtMessage” value=“Ultimate Connections”\>…  
…\<input type=“checkbox” name=“txtMessage” value=“Contact Me About Life Coaching”\>…

Here’s an example of how my flash form works;

var variables:URLVariables = new URLVariables();  
var varSend:URLRequest = new URLRequest(“website”);  
var varLoader:URLLoader = new URLLoader;  
varSend.method = URLRequestMethod.POST;  
varSend.data = variables;

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

function ValidateAndSend (event:MouseEvent):void {

```
if(!txtfirst.length) {
status_txt.text = "* Please enter your first name";
} else {

```

variables.txtContactFirstName = txtfirst.text;

varLoader.load(varSend);  
}

Thanks guys !
