javascript函数在提交后清除表单中的所有值 [英] javascript function to clear all values from a form after submit
本文介绍了javascript函数在提交后清除表单中的所有值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在asp.net中构建,其中有一个webform,需要在单击提交按钮后清除所有值
解决方案
Google [ ^ ]它。 />
http:// www。 javascript-coder.com/javascript-form/javascript-reset-form.phtml [ ^ ]
您可以清除代码中的值,例如:
TextBox1.Text = string.Empty;
另外,请查看以下链接:
HTTP://www.d reamincode.net/code/snippet1238.htm [ ^ ]
祝你好运!
< form name =form1action =#>
公司名称:< input type =textsize =35name =company_name>
选择< input type =radioname =data value =1>公司
< input type =radioname =business_categoryvalue =2>男性
< input type =radioname =datavalue =4>女性
电子邮件地址:< input type =textsize =30name =email>
保持信息私密:< input type =复选框name =privacy>
< input type =buttonname =reset_formvalue =重置表单onclick =this.form.reset();>
< input type =buttonname =clearvalue =Clear Formonclick =clearForm(this.form);>
< /形式>
building in asp.net which has a webform that needs all its values cleared after clicking submit button
解决方案
Google[^] it.
http://www.javascript-coder.com/javascript-form/javascript-reset-form.phtml[^]
You can just clear the values in your code, like:
TextBox1.Text = string.Empty;
Also, check out this link:
http://www.dreamincode.net/code/snippet1238.htm[^]
Good luck!
<form name="form1" action="#">
Company Name: <input type="text" size="35" name="company_name">
Select <input type="radio" name="data" value="1"> Company
<input type="radio" name="business_category" value="2"> Male
<input type="radio" name="data" value="4"> Female
Email Address: <input type="text" size="30" name="email">
Keep Information Private: <input type="checkbox" name="privacy">
<input type="button" name="reset_form" value="Reset Form" onclick="this.form.reset();">
<input type="button" name="clear" value="Clear Form" onclick="clearForm(this.form);">
</form>
这篇关于javascript函数在提交后清除表单中的所有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文