View Full Version : It is allowing me to select more buttons than I should do

malcolm p
12-14-2011, 02:17 AM
Please follow these steps in the jsfiddle

1. Click on open grid link and select option "3", buttons A,B and C would appear

2. Enter in number 2 in the number of Answers textbox. Then select buttons A and C

3. Now click on the open grid again and select option 6.

4. Now the number of Answers textbox is empty so type in 2 again in the text-box. So only 2 answers should be selected which is A and C. So if you click on another button the alert message should appear stating you are beyond limit, deselect another button. But this does not happen. Instead the user can select another 2 buttons and then the alert message would appear if another button is selected. This means that 4 buttons are selected which is incorrect, it should still be 2.

So does anyone have an idea why it is doing this?


Code is in jsfiddle, click [here][1]

[1]: http://jsfiddle.net/C7vcQ/2/

Old Pedant
12-14-2011, 02:32 AM
Same answer as in other thread. Because you are doing this all in jQuery, you are obscuring (to me, at least) what is happening.

It would be easy to fix this in standard JavaScript code, but I think you need to ask the jQuery experts, because of how the code is written.