如何清除多个文本框 [英] how to clear multiple no of textboxes

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

问题描述



我可以通过编码清除多个文本框吗

如果它们很丰富


can i get the coding to clear multiple no of textboxes
if they are plentiful

推荐答案

获取表单中的控件类型,如果它们是文本框,请清除它们。



Get the type of controls in your form, and if they are textboxes, clear them.

foreach (TextBox txt in this.Controls.Find("textBox",true))
 {
    txt.Clear();
 }


试试这个,



Try this,

<input style="cursor: hand; width:80px;" title="reset all fields" type="button" value="Reset"  önclick="javascript:reset()" id="btReset" name="btReset" />





这将清除页面上的所有字段。无需计算多少。



This will clear all the fields on the page. No need to count how many.


textbox1.Text="";
textbox1.Text=null;


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

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