Reputation: 673
I am new to jQuery, but I would like to have a button that when clicked will add more textboxes to a page. I have three textboxes that contain data of the same type and if the user has more data of the same type to enter, I would like to pop up three more textboxes.
What would be the best way to go about that?
Upvotes: 1
Views: 903
Reputation: 105029
$("<input type='text' name='as_it_should_be'>").append(...).
Check jQuery documentation.
Regarding Asp.net MVC model binding to collections of data, this may help as well.
Upvotes: 0
Reputation: 25339
I'd recommend reading Editing a variable length list, ASP.NET MVC 2-style by Steve Sanderson. It explains how to achieve what I believe you are trying to do.
Upvotes: 1