Guest Spalton Posted September 16, 2010 Report Posted September 16, 2010 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now