how to add text boxes in "ADD MORE" button [Resolved]

Posted by SU77YA under ASP.NET MVC on 3/3/2016 | Points: 10 | Views : 1431 | Status : [Member] | Replies : 1
I made a page in .net mvc and added text boxes for location Address i.e address , city, state, country, pin code... and put "ADD MORE" i just want when user click on ADD MORE button then address,city ,state,country,pin code textboxes again appear so that he can add more location addresses


Posted by: Key123 on: 3/3/2016 [Member] Starter | Points: 50


In the Click event of the "Add more" button, you have to add the dynamic html,
var itemCount = $('div.addRow').length;

id = itemCount + 1;
var newDiv= $('<div class="addRow">');
var row= '<span><input type="text" id="state'+id+'"/></span>';
row= row + '<span><input type="text" id="country'+id+'"/></span>';
The Html should be,
<div id=divDetails></div>

Try this..

SU77YA, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response