How to Add another text box value in this jquery code
How to Add another text box value in this jquery codei want to get the value of dynamic text box value on button click.
in this query i can add one text box value that is DynamicTextBox1.
also am created another one that is DynamicTextBox2, all is working fine. but i cant able to get the DynamicTextBox2 value exavtly.
so please help me to am get and add the another(DynamicTextBox2) one text box value to this jquery.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var values1 = eval('<%=Values1%>');
var values2 = eval('<%=Values2%>');
if (values1 != null) {
var html = "";
$(values1).each(function () {
var div = $("<div />");
div.html(GetDynamicTextBox(this));
$("#TextBoxContainer").append(div);
});
}
$("#btnAdd").bind("click", function () {
var div = $("<div />");
div.html(GetDynamicTextBox(""));
$("#TextBoxContainer").append(div);
});
$("body").on("click", ".remove", function () {
$(this).closest("div").remove();
});
});
function GetDynamicTextBox(value) {
return '<input name = "DynamicTextBox1" type="text" value = "' + value + '" /> '+'<input name = "DynamicTextBox2" type="text" value = "' + value + '" /> '+
'<input type="button" value="Remove" class="remove" />'
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="btnAdd" type="button" value="add"/>
<br />
<br />
<div id="TextBoxContainer">
<!--Textboxes will be added here -->
</div>
<br />
<asp:Button ID="btnPost" runat="server" Text="Post" OnClick="btnPost_Click" />
</form>
</body>
Thanks with
Paul.S