clear the textbox on click os submit button in update panel
-
Hi, I have a submit button in update panel and textbox which is not there in update panel. when i type something in textbox and press enter the submit should be clicked and textbox text should be cleared. I was able to get the first part.But the text is not getting cleared from textbox. Here is the snippet code: txtmsg.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btn1.UniqueID + "').click();return false;this.value='';}} else {return true;this.value='';} "); also i have tried to clear the textbox values by using document.getelementbyid('textboxname').value="" but it does not work.... i have tried many solutions on the net they are not working.. This is really urgent any help is really appreciated. Thnaks in adavnce
-
Hi, I have a submit button in update panel and textbox which is not there in update panel. when i type something in textbox and press enter the submit should be clicked and textbox text should be cleared. I was able to get the first part.But the text is not getting cleared from textbox. Here is the snippet code: txtmsg.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btn1.UniqueID + "').click();return false;this.value='';}} else {return true;this.value='';} "); also i have tried to clear the textbox values by using document.getelementbyid('textboxname').value="" but it does not work.... i have tried many solutions on the net they are not working.. This is really urgent any help is really appreciated. Thnaks in adavnce
Hi, sorry, could you just clarify.... You have a web form and it has 1) An update panel 2) A TextBox outside the UpdatePanel 3) A Button inside the UpdatePanel then you want to 1) User to type in text box 2) User to click the Button 3) Button to submit request - Panel to update 4) Textbox to clear after all this has taken place
Mark Graham (MCP) // The Doodler blogging about C#, Asp.Net, and Design Patterns at: csCoffee[^] and contributing at dotNet Notepad[^]