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.

3
  • Are you cool with using jQuery? Commented Apr 29, 2011 at 22:38
  • possible duplicate of Adding rows dynamically with jQuery Commented Apr 29, 2011 at 23:41
  • Yes yes, I want to use jQuery if possible. Commented May 5, 2011 at 15:00

1 Answer 1

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()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.