Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    It is allowing me to select more buttons than I should do

    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?

    Thanks

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


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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •