SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    0 Post(s)
    0 Thread(s)

    It does not allow me to select any buttons if there is a number in a textbox


    In my application what happens is that the user chooses a button by clicking on the (open Grid) link and selecting a button. Then what happens is that a set of buttons appear below depending on what the user has chosen. The user is supose to determine how many answers he wants to select in the text box (in other words how many buttons does the user want to select). For example if the user enters "2" in the textbox, then the user can only select 2 buttons below. The problem is that if the user types in a number in the text box, then it would not allow the user to select a button, (a button is selected if the color of the button turns green). but if I remove the number which is in the text box, then if I click on a button it comes up with an alert message stating that you should determine the number of answers you want, this is correct.

    So why is it not allowing me to select any buttons if there is a number inside the "Number of Answers" textbox?

    Code is in jsfiddle, click

    Thank You

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Christchurch, New Zealand
    104 Post(s)
    4 Thread(s)
    The issue that's causing the problem is in the fromCharCode part of the code.

    letter = letter.String.fromCharCode(i);
    The letter variable doesn't have a property called String, which is why you're getting the fromCharCode error, so you should just use this instead:

    Code javascript:
    letter = String.fromCharCode(i);
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Posting Permissions

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