What is happening is that when the user selects the option "True or False" in a particular row, a string is appering in two places where actually it is suppose to appear in one place. If you follow the steps in my fiddle then you will understand what is happening.

Step 1: open the grid and select option 4. You will see that a textbox below the option appears for the number of answers. (This happens for options 3, 4 and 5 but not True or False which instead displays a string "Only 1 Answers").

Step 2:Click on the "add question" button, this will insert your details into a new row.

Step 3: Now in the row you have just added, select open grid and click on option "True or False". Now what happens is that if you look at the "Number of Answers" column next to the "Option Type" column, it will display the string "Only 1 Answer". This is fine.

The problem is that if you look at the control at the top and look at the "Number of Answers" section, it displays "Only 1 Answer", this should not happen. If something is change withing a row, it should not alter anything on the top control. I have manged keep Option Type and Answer buttons from altering when its same control is altered within the row but I do not how to do it for Number of Answers.

Can anyone fix this because I cannot figure out what to do? Please test your coding in the fiddle if you want to attempt to fix this by coding.

code is in jsfiddle, click http://jsfiddle.net/dtJaK/10/

Without trying to find the JS code, I'll guess. :)

Add two or more questions, then select True/False for one, and all of them are changed.

All three <input> tags are identical. I'll guess that the code is finding all <input>s with name = "numberAnswer", deactivating them and activating the sibling <span>. And the sibling spans all have 'Only 1 Answer' as their innerHTML.

Give the inputs unique names and see what happens.

You can easily see all this by using Firefox and the Firebug JS debuggerer. Opera and its debuggerer might even work by now; last I tried it a year or two ago, it wasn't ready for prime time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.