Trying to find a better way to clear textboxes

Discussion in 'ASP .Net' started by TN Bella, Jul 14, 2004.

  1. TN Bella

    TN Bella Guest

    Hi,
    Here is part of one sub where I want to clear all textboxes (there are
    three subs where I do this, one contains more textboxes, the other is
    below and the final one looks the same but omits the
    txtInvLoc.SelectedItem box). Some of the examples online didn't work out
    to well for me. I want a shorter way to clear the fields, but also
    another option that clears all fields but one: txtInvLoc.SelectedItem.
    Can someone direct me to an example or show me how I can accomplish this
    task? Thanks in advance for the assistance.

    Sub ClearForm (Source As Object, Args As EventArgs)

    txtSupName.Text = ""
    txtSupCD.Text = ""
    txtSupsfx.Text = ""
    txtAcctAmt.Text = ""
    txtInvNum.Text = ""
    txtInvDate.Text = ""
    txtInvLoc.SelectedItem.Value = ""
    txtInvAmt.Text = ""
    txtTerms.SelectedItem.Value = ""
    txtPay.SelectedItem.Value = ""
    txtCurr.SelectedItem.Value = ""

    End Sub
    (there are actually textboxes and dropdownlists(selected.value).

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    TN Bella, Jul 14, 2004
    #1
    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. Peter Afonin
    Replies:
    7
    Views:
    14,460
  2. =?Utf-8?B?YW1yaXRh?=
    Replies:
    1
    Views:
    409
    Hermit Dave
    Jan 23, 2004
  3. Replies:
    3
    Views:
    735
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 4, 2004
  4. Paul D. Fox
    Replies:
    6
    Views:
    19,168
    =?Utf-8?B?bWlrZQ==?=
    May 22, 2005
  5. =?Utf-8?B?bGFuZW0=?=

    Textboxes clear on postback

    =?Utf-8?B?bGFuZW0=?=, Aug 30, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,502
    =?Utf-8?B?bGFuZW0=?=
    Aug 30, 2006
Loading...

Share This Page