What I’m looking for is some references or documents which provide information on performing jQuery and AJAX tricks for adding multiple inputs to a form at the click of a button. A great example would be Google’s Gmail client, which allows for the addition of adding multiple attachments to an email. The implementation behind that allows for a large amount of input fields which may appear out of thin air at the click of a button.
What I’m looking for is some references or documents which provide information on performing
Share
Ok, kinda vague but i’ll have a go.
What you can do is three things.
1) Clone a section of the form using jQuery and then append the clone where you want it to go.
2) Simply add the new controls using jQuery native.
3) Call an ashx file which in turn returns a web user control and then append that to where you want it to be.
So for item 3;
Now the ashx;
Use this link http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx to get the code for ViewManager and how to return a view from an ashx file.
I really hope this helps you
Option 1
this simply involves having the following html
now your jQuery might look like this;
http://api.jquery.com/clone/
Option 2
http://api.jquery.com/append/