Web TextBox TextChanged Event

  • Thread starter Thread starter pvdg42
  • Start date Start date
P

pvdg42

Working on a web project (academic example) for a beginning VB class where
there are four text boxes, each to hold four characters. I want focus to
shift automatically to the next text box when the user has entered the 4th
character in a given text box.

I'm trying to use the TextChanged event to make this happen, but it appears
as if the TextChanged event never fires? I thought it would fire each time
the user entered a new character so that a test could be made like...

If TextBox1.Text.Length > 3 Then
TextBox2.Focus()
End If

It muse be something basic I don't understand about events and web pages?
 
Did you enable autopostback for the textbox? Otherwise the server-side code
won't be called unless some other postback event occurs. This could be the
wrong approach however. It may be easier to set the taborder on the
textboxes for this, in addition to using a javascript to help move it along.
 
Mark Fitzpatrick said:
Did you enable autopostback for the textbox? Otherwise the server-side
code won't be called unless some other postback event occurs. This could
be the wrong approach however. It may be easier to set the taborder on the
textboxes for this, in addition to using a javascript to help move it
along.
Thanks, Mark.
I had tried enabling AutoPostback without beneficial results, so I guess
it's the JavaScript route...
 
Back
Top