Hi All,
I am creating the textbox dynamically & I am entering data into it. when i say ADD New text box button I am loosing the data which i entered in previous textboxes ..
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sam HobbsRank #107 · 20.5K reputationPosted Jan 27, 2012, 10:53 AM EST
SIVARank #2,303 · 613 reputationPosted Jan 29, 2012, 11:03 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 30, 2012, 1:42 AM EST
This is due to page post back.
I this you may add textbox using JavaScript or jquery.
so page not get post back.
hope this help.
Mayur GujrathiRank #666 · 3.6K reputationPosted Jan 30, 2012, 4:18 AM EST
Always keep textbox data in datatable whenever you add new textbox and call SetPreviousData method and assign againn all values from databale to textboxes
Try this example...........
What sam wants to tell not getting??????????
SIVARank #2,303 · 613 reputationPosted Jan 30, 2012, 4:35 AM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 30, 2012, 5:39 PM EST
Can please Share more information?
How u add dynamically Text box ? using Javascript or C# code?
I think also there is problem of Script.
SIVARank #2,303 · 613 reputationPosted Jan 30, 2012, 11:09 PM EST
<
input id="btnAddJK" style="width:26px;height:20px" type="button" value="add" size="30" align="top" onclick="btnAddJK_onclick()" />& onclick() event which is presented in Script tag as follows.
var
function btnAddJK_onclick() {var _txtID="txtJK"+_CountJK;
var d = document.getElementById("divJK");
d.innerHTML += "";
_CountJK++;
}
_CountJK = 2;Review this code & reply me