The implementation record of the refill button during my first system operation is as follows:
You can set the background image with imagebutton for the first time, and then write the following in the Click Event of the background:
This. txtcallno. Text = "";
This. txtcaller. Text = "";
This. txttrandate. Text = "";
This. txttranlimit. Text = "";
This. txttranno. Text = "";
This. txttranpres. Text = "";
This. radiobutton1.checked = false;
This. radiobutton2.checked = false;
This. dlstunit. selectedindex = 0;
The second operation also uses imagebutton, which is written in the click event as follows:
Foreach (control C in form1.controls)
{
If (C is textbox)
(Textbox) c). Text = "";
If (C is dropdownlist)
(Dropdownlist) c). selectedindex = 0;
If (C is radiobutton)
(Radiobutton) c). Checked = false;
}
The third time is to use <a href = "#">
Use JavaScript to write the reset () method:
Function reset ()
{
VaR Len = Document. form1.elements. length;
VaR I;
For (I = 0; I <Len; I ++)
{
If (document. form1.elements [I]. type = "text ")
{
Document. form1.elements [I]. value = "";;
}
If (document. form1.elements [I]. type = "radio ")
{
Document. form1.elements [I]. Checked = false;
}
}
VaR obj1 = Document. getelementbyid ("dlstcallerway ");
VaR obj5 = Document. getelementbyid ("txtremark ");
Obj5.value = "";
Obj1.selectedindex = 0;
// The client type of the dropdownlist cannot be obtained. I do not know how to obtain the Js.
// When the textmode of the text box is set to multiline, the type can only be obtained by ID if it cannot be obtained.
}
These three methods are empty, not reset or refill, because sometimes the reset request is that the original data is retained after you click the reset button in the control.
Data. For example, when textbox1 loads a page, the value is "Hu Shuai". After clicking it, it is still "Hu Shuai". The preceding method is cleared after clicking it.
Method 4:
<Input type = "image" src = "images/but2.gif" name = "reset"
Onclick = "form1.reset (); Return false;"/>