views:

91

answers:

1

What I am trying to do is very similar to this question:
http://stackoverflow.com/questions/1894009/using-jquery-to-dynamically-add-form-fields-or-fieldsets-based-on-a-dropdown-bo

Specifically, I want to use a drop down box value to add that number of input boxes to a fieldset.

I do not know jQuery so the answer I am linking to hasn't answered my question, I would like to know how to do this in JavaScript?

+1  A: 

There are lots of instructions on how to use JQuery. I suggest that you go to http://docs.jquery.com to learn it rather than looking here for a specific answer to your question. Spending the time to figure it out for yourself will be far more useful than a copy-paste answer.

You'll follow some basic steps. Tackle each one individually.

  • Read the value from the drop-down when it changes.
  • Find the element to contain the new input boxes.
  • Loop through the number of values
  • Insert the appropriate HTML for each loop iteration.
John Fisher