开发者

ASP MVC add textboxes with jquery

开发者 https://www.devze.com 2022-12-27 07:41 出处:网络
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 th

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 开发者_如何学Pythonway to go about that?


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.


$("<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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号