Easy Checkbox Numbering
Easy Checkbox Numbering
I need to figure out a way to populate a hidden div, which is associated with a checkbox, with the number in which the checkbox was checked. Essentially, you would check a random box, and a little number would pop up next to it saying it was the first box you selected. Then you'd scroll down the list a bit, select another box, and it would indicate that you just made your second selection... and so on.
Okay, I've got about 30 checkboxes listed, like so:
Goal One <input type='checkbox' value='goals[1]' name='goals[1]' />
<div id='hidden[1]'>Order in which I was clicked is - (#)</div>
Goal Two <input type='checkbox' value='goals[2]' name='goals[2]' />
<div id='hidden[2]'>Order in which I was clicked is - (#)</div>
Goal Three <input type='checkbox' value='goals[3]' name='goals[3]' />
<div id='hidden[3]'>Order in which I was clicked is - (#)</div>
They go on like that, but I'm only listing three here, so you don't have to scroll all day.
Basically the jquery would need to keep track of how many checkboxes have been checked, and post that amount next to each checked box, in the order they are checked. Make sense? I'm stuck.