Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
building in asp.net which has a webform that needs all its values cleared after clicking submit button
Posted

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!
 
Share this answer
 
<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>
 
Share this answer
 
Here try these

Using JavaScript
Simple and easy way to clear all the input fields in the form.[^]
Using Server side Codebehind
Simple and easy way to clear all the input fields in the form.[^]

HTML Reset button
Reset Button[^]

Use Reset by Js
Form reset() Method[^]
 
Share this answer
 

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