reset values on a webform

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
 
G

Giorgio Parmeggiani

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
 
B

Bernie V

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
 
G

Giorgio Parmeggiani

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
 
B

Bernie V

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
 
B

blender

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top