Guest Spalton Posted September 16, 2010 Report Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.