reset values on a webform

Discussion in 'ASP .Net' started by Bernie V, Nov 1, 2003.

  1. Bernie V

    Bernie V Guest

    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
     
    Bernie V, Nov 1, 2003
    #1
    1. Advertising

  2. 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, Nov 1, 2003
    #2
    1. Advertising

  3. Bernie V

    Bernie V Guest

    "Giorgio Parmeggiani" <> schreef in bericht
    news:...
    > 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
    >


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

    thx in advance,

    gr

    Bernie V
     
    Bernie V, Nov 1, 2003
    #3
  4. Hi Bernie

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

    > 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, Nov 1, 2003
    #4
  5. Bernie V

    Bernie V Guest

    "Giorgio Parmeggiani" <> schreef in bericht
    news:...
    > Hi Bernie
    >
    > > > You can use a ResetButton:
    > > > <INPUT type="reset" value="Reset">
    > > >

    > > 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
     
    Bernie V, Nov 2, 2003
    #5
  6. Bernie V

    Guest

    Another way to do it is:

    document.forms[0].reset();




    On Sat, 1 Nov 2003 22:54:27 +0100, "Giorgio Parmeggiani"
    <> wrotC:
    >Hi Bernie
    >
    >> > You can use a ResetButton:
    >> > <INPUT type="reset" value="Reset">
    >> >

    >> 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
    >
     
    , Nov 3, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. titof
    Replies:
    0
    Views:
    515
    titof
    Jul 24, 2003
  2. timmso
    Replies:
    1
    Views:
    495
    Alex Papadimoulis
    Dec 12, 2003
  3. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    469
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  4. =?Utf-8?B?Vk1J?=

    Moving value from popup Webform to main Webform?

    =?Utf-8?B?Vk1J?=, Oct 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    580
    GroupReader
    Oct 9, 2006
  5. Luqman
    Replies:
    2
    Views:
    665
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 11, 2007
Loading...

Share This Page