Web TextBox TextChanged Event

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?
 
M

Mark Fitzpatrick

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.
 
P

pvdg42

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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top