This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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
Author

Do I need to copy the functions?

Carl Brooks
Greenhorn

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


[1]: http://jsfiddle.net/rSdwa/15/

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do I need to copy the functions?