# Passing value from checkbox component to loadVars object

**URL:** <https://forum.kirupa.com/t/passing-value-from-checkbox-component-to-loadvars-object/204613>\
**Category:** flash\
**Created:** [October 21, 2006, 2:02pm UTC](https://forum.kirupa.com/t/passing-value-from-checkbox-component-to-loadvars-object/204613 "2006-10-21T14:02:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/smax/32/2916_2.png) [@Smax](https://forum.kirupa.com/u/Smax)\
**Post date:** [October 21, 2006, 2:02pm UTC](https://forum.kirupa.com/t/passing-value-from-checkbox-component-to-loadvars-object/204613/1 "2006-10-21T14:02:54Z")

</div>

Hi, I’ve done a search but can’t find the answer to this.

I want to pass the value of a checkbox in a survey to a loadVars object to be sent to a PHP form.

I have a checkbox on the stage with the instance name button5a. I’ve read that I can’t use getValue for checkboxes, and that I have to use a listener object. So I have:

```auto

submit_btn.onRelease = function(){
    var questionVar:LoadVars = new LoadVars();
    questionVar.question5a = "";

var checkboxListener = new Object();
checkboxListener.click = function (evt){
    questionVar.question5a = "Interviews";
}
button5a.addEventListener("click", checkboxListener);

questionVar.sendAndLoad("http://www.mysite/insert.php", questionVar, "POST");
    questionVar.onLoad = function(){
        gotoAndPlay(2);
    }
}

```

When the checkbox is selected I want to give the loadVars object the information “Interviews”. But it just returns a blank value.

I’ve cobbled this code together from different tutorials and I’m guessing at it really!  
Any help on what I should be doing appreciated.
