Jump to content

Recommended Posts

Posted

Hi guys, first time poster here, spent the morning scratching my head and hoping you can help!

 

 

I've got a number of forms (form1, form2, form3....) all of which have a checkbox in them (script1CheckBox, script2CheckBox, script3CheckBox...etc etc).

 

When a checkbox is clicked it calls the following procedure, basically I need to know WHICH checkbox was clicked. I am a totla newbie when it comes to this but came up with the below:

 

function assignVar()

{

 

for (var arrNum = 0; arrNum <= 30; arrNum++)

{

 

formNum = "form"+arrNum;

scriptCheckNum = "scriptCheckBox"+arrNum;

if (document.(formNum).(scriptCheckNum).checked)

{

questionNumber = arrNum;

return questionNumber;

console.log(questionNumber);

}

 

}

}

 

yet am getting no output from it. Can anyone point out where I'm going wrong?

 

Thankyou in advance!

 

Chris

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...