Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeater Control

Status
Not open for further replies.

Fletch12

IS-IT--Management
Aug 13, 2002
140
US
I am having some difficulty clearing text boxes after the submit button is clicked. The submit button works and adds a new record, but the information remains in the text boxes even after the page has been refreshed. All I have is 7 text boxes laid out on the page. Could someone please help me out.
 
Hi Fletch12,

The following will clear the text of all textboxes on a form.

Code:
Private Sub ClearAllTextFromTextBoxes(byref f as Form)

    Dim c As Control

    For Each c In f.Controls
        If TypeOf(c) Is TextBox Then
            CType(c, TextBox).Text = ""
        End If
    Next

End Sub

Hope it's what you're after.

T0AD

There's a thin line between genius, and insanity!
 
TOAD,

I received the message "Type 'Form' is not defined."
 
The above example is for a windows application, is this what you're using?

There's a thin line between genius, and insanity!
 
I have no experience in Web App's, so the following might not work - but try it just in-case. Place this at the end of the routine that runs when your submit button is clicked.

Code:
    Dim c As Control

    For Each c In Me.Controls
        If TypeOf(c) Is TextBox Then
            CType(c, TextBox).Text = ""
        End If
    Next

Hope it works.
T0AD

There's a thin line between genius, and insanity!
 
I really appreciate the help, but still no luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top