Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There are two radiobuttons which having two textbox,suppose if i select one radiobutton and put text in textbox but without submitting if i change and select another radibutton then How we clear the previus text of textbox where there is already text because its creating problem.just let me know?
Posted

XML
function clrCtrl()
{
document.getElementById('ctl00_ContentPlaceHolder1_TextBox1').value = "";
document.getElementById('ctl00_ContentPlaceHolder1_TextBox2').value = "";
}
<asp:Button ID="ClearButton" runat="server" Style="position: static" Text="Button" OnClientClick="clrCtrl()" />
 
Share this answer
 
u can use htmlradiobutton and on onclick event call javascript function to clear your respective textbox. like

C++
<input type="radio" onclick="javascript:clearall(this)" runat="server" />
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900