malcolm_p — 2011-12-11T12:25:21-05:00 — #1
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 http://jsfiddle.net/pSy97/12/
paul_wilkins — 2011-12-11T17:53:05-05:00 — #2
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:
letter = String.fromCharCode(i);