PDA

View Full Version : Submitting checkbox output to a list box


gaz20
03-02-2009, 02:33 PM
Hi,

I am trying to create a a checkbox based form that will submit the checkboxes that have been clicked and checked by pressing a submit button.

This then should pass this through to a list box to display the results.

My actionscript isn't that good as I have very basic flash knowledge. I have most of my actionscript in a layer called "actions" and ther is some code in the "Submit" button component, where most of my problems have arisen. When I run the file I can check the checkboxes but when I click the submit button, nothing happens, however, if I were to click the submit button in the stage view it goes to the point in the timeline I have told it to in the actionscript.

Please help!! :confused:

"Submit" button code

//Submit button
butSubmit.onRelease = function() {

submit();
};
function submitOutput() {
//define object to hold result
Results = new LoadVars();
//Define object to hold vars
myCheckBoxVar = new LoadVars();
//Attach vars to object
rShoulder = rShoulder.CheckBox;
lShoulder = lShoulder.CheckBox;
rElbow = rElbow.CheckBox;
lElbow = lElbow.CheckBox;
rWrist = rWrist.CheckBox;
lWrist = lWrist.CheckBox;
rKnee = rKnee.CheckBox;
lKnee = lKnee.CheckBox;
rThumb = rThumb.CheckBox;
rThumbtip = rThumbtip.CheckBox;
r1stFinger = r1stFinger.CheckBox;
r1stFingertip = r1stFingertip.CheckBox;
r2ndFinger = r2ndFinger.CheckBox;
r2ndFingertip = r2ndFingertip.CheckBox;
r3rdFinger = r3rdFinger.CheckBox;
r3rdFingertip = r3rdFingertip.CheckBox;
rPinky = rPinky.CheckBox
rPinkytip = rPinkytip.CheckBox;
lThumb = lThumb.CheckBox;
lThumbtip = lThumbtip.CheckBox
l1stFinger = l1stFinger.CheckBox;
l1stFingertip =l1stFingertip.CheckBox;
l2ndFinger = l2ndFinger.CheckBox;
l2ndFingertip = l2ndFingertip.CheckBox;
l3rdFinger = l3rdFinger.CheckBox;
l3rdFingertip = l3rdFingertip.CheckBox;
lPinky = lPinky.CheckBox;
lPinkytip = lPinkytip.CheckBox;

//Send vars to script
myCheckBoxvar.sendAndLoad();
Results.onLoad = function(success) {
if (success) {
//on the last line of the php script put
// echo "&retval=1&";
if (Results.retval.length > 0) {
gotoAndStop(8);
} else {
//incase of error trace what has been sent back
trace("ERROR:" + newline + unescape(Results));
}
}
};
}