views:

103

answers:

2

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?

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

Robert Koritnik
A: 

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.

Dan Diplo
That is basically what I need. But I need to do it without a strongly typed view because there are multiple types of data on the same page.
Jacob Huggart