aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Do I need to copy the functions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Do I need to copy the functions?" Watch "Do I need to copy the functions?" New topic

Do I need to copy the functions?

Carl Brooks

Joined: Dec 24, 2011
Posts: 2
How do I match the functions from the top of my jsfidde, Options, Number of Answers and Answers with the same features for each and every table row which is added when user clicks on the "Add question" button.

The function that adds the new rows is near the bottom of the javascript section which is known as "insertQuestion(form)" and the other functions above controls the Option Types, Number of Answers and Answers features.

Can I copy and paste the functions but match them with the right ids and class which is in the insertQuestion(form) to control each feature within the rows. If so where do I copy the functions?

Follow these steps to help use the fiddle:

Step 1: Open the fiddle and you see an options and answers section on top. Open the grid and select option 8. Buttons A to H would appear.

Step 2: Type in 2 in the Number of Answers Textbox.

Step 3: Select buttons A and D, you will find out that those buttons would turn green to show they are selected. Now as you entered in 2 in the Number of answers textbox (step 2), it won't let you select more than 2 buttons, if you do an alert would apear stating you are beyond limit please deselect a button to choose another button.

Step 4. Click "Add Question", a new row is added in the table.

Step 5: In the new row you just created, lets say that oh no I made a mistake, there should be 4 answers not 2 answers and within the table row you just added you changed the number of answers textbox from 2 to 4. Select you buttons, hek select 5,6,7 buttons nothing is stopping you. This is the problem. You try and do that on the options and answers feature on top of the fiddle it does not let you do that but it lets you do it in the table row. This is the problem.

Whole code is in jsfiddle, click [here][1] Please test your answers in the fiddle if you wish before posting your answer. More chances of getting the correct answer


I agree. Here's the link:
subject: Do I need to copy the functions?