RE : code taken from Kirupa.com’s form tutorial
here is my published swf
Hi, could anyone help me modify the code for these checkbox components?
right now, the SUBMIT button checks which ones of the checkboxes are checked and gets their label, then
writes the appropriate labels in a dynamic text box.
// HERE IS THE CODE FOR THE Checkbox Components-----------
// Array of the instance names of the checkboxes
myCheck = [one,two,three,four,five,six,seven,eight,nine]; // Function
function checkDisplay(component) {
var j,s;
for(j in myCheck){
if(myCheck[j].getValue()) s += myCheck[j].getLabel()+"
";
}
checke = ((s.length) ? s : “Nothing”);
}
// As usual…
for (i=0;i<myCheck.length;i++) {
myCheck*.setChangeHandler (“checkDisplay”) ;
}
// Push Buttons
// ---------------
// Reset button function
onReset = function () {
// checkbox
var j;
for (j in myCheck) {
myCheck[j].setValue(false);
//vider la boite texte
result.text = “”;
}
}
// Submit button function
onSubmit = function () {
texte = comment.text;
//to make choice appear in dynamic text box
result.text+= checke;
}
For the program I am doing, I need to have a maximum of 6 checkmarks and each one of the checked label must
go into its own variable. (see gray part of the swf)
I would also like the labels to appear in the right order, right now it’s inversed.
please see source file:
thanks…a lot!
-Isabelle