1

What is a way that I can make a button to spawn infinite forms? Any method would work, but I just can't think of any. This is kind of the layout I am thinking of

Country  |   Province   |   Topic   |   

China    |   Beijing    |   Flood   |   (+)
China    |   Shaanxi    |   Flood   |   (+) 

In this imaginary example, the plus button would spawn another form where the values would be identical, but allow the user to change one field, if an event is affecting more than one place.

Ryan Ward Valverde
  • 6,458
  • 6
  • 37
  • 48

1 Answers1

2

You could create a form element on the fly with jQuery, and then use the append() function to append that form to the current row. In the examples of the append documentation you can see how to create new elements.

Also, here you can see how to create a new element and automatically append it using appendTo()

Community
  • 1
  • 1
Jose Armesto
  • 12,794
  • 8
  • 51
  • 56