如何清除文本框的文本? [英] How to clear the Text of textbox ?

查看:134
本文介绍了如何清除文本框的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有两个具有两个文本框的单选按钮,假设如果我选择一个单选按钮并将文本放入文本框,但是如果我更改并选择另一个单选按钮则不提交,那么我们如何清除文本框的上一个文本,因为已经创建了该文本问题.只让我知道吗?

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?

推荐答案

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()" />


u可以使用htmlradiobutton和onclick事件调用javascript函数来清除您各自的文本框.喜欢

u can use htmlradiobutton and on onclick event call javascript function to clear your respective textbox. like

<input type="radio" onclick="javascript:clearall(this)" runat="server" />


这篇关于如何清除文本框的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆