Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Trying to find a better way to clear textboxes

Thread Tools

Trying to find a better way to clear textboxes

TN Bella
Posts: n/a
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 ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I loop through TextBoxes and clear them? Paul D. Fox ASP .Net 6 05-22-2005 03:24 AM
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM
How do you clear textboxes on postback ASP .Net 3 10-04-2004 02:23 PM
how to clear all the textboxes in a table on clicking cancel =?Utf-8?B?YW1yaXRh?= ASP .Net 1 01-23-2004 11:19 AM
How to clear all textboxes on Webform using VB.Net Peter Afonin ASP .Net 7 10-18-2003 01:49 PM