reset values on a webform

  • Thread starter Thread starter Bernie V
  • Start date Start date
B

Bernie V

Hi group,

I have a waebform to send emails.
On the form there are 2 buttons: A button "send" and a button "reset".

If I click aon the button my email is send, but I want to reset the values
on my form (to send another email).

How can I do that. ?

thx in advance !

gr

Bernie V
 
Hi
If I click aon the button my email is send, but I want to reset the values
on my form (to send another email).

You can use a ResetButton:
<INPUT type="reset" value="Reset">

Hi
Giorgio
 
Giorgio Parmeggiani said:
Hi


You can use a ResetButton:
<INPUT type="reset" value="Reset">

Hi
Giorgio

thx for the tip, bit is it also possible with code in stead of a button ?

thx in advance,

gr

Bernie V
 
Hi Bernie
thx for the tip, bit is it also possible with code in stead of a button ?

Yes you can reset your form using Javascript client code, here an example:

in the HTML page
<script language=javascript>
function reset()
{
document.forms[0].email.value="";
..........
document.forms[0].cc = "";
}
</script>

in the codebehind(at example in the Page_Load event):

this.Button1.Attributes.Add("OnClick", "java" + "script:Reset();");

Giorgio
 
Giorgio Parmeggiani said:
Hi Bernie
thx for the tip, bit is it also possible with code in stead of a button ?

Yes you can reset your form using Javascript client code, here an example:

in the HTML page
<script language=javascript>
function reset()
{
document.forms[0].email.value="";
..........
document.forms[0].cc = "";
}
</script>

in the codebehind(at example in the Page_Load event):

this.Button1.Attributes.Add("OnClick", "java" + "script:Reset();");

Giorgio

thx a lot !!
Bernie V
 
Another way to do it is:

document.forms[0].reset();




Hi Bernie
thx for the tip, bit is it also possible with code in stead of a button ?

Yes you can reset your form using Javascript client code, here an example:

in the HTML page
<script language=javascript>
function reset()
{
document.forms[0].email.value="";
..........
document.forms[0].cc = "";
}
</script>

in the codebehind(at example in the Page_Load event):

this.Button1.Attributes.Add("OnClick", "java" + "script:Reset();");

Giorgio
 
Back
Top