Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello to everyone,

 

i have a problem that i tried to explain. if anyone help me, i will be gratefull.

My problem:

i have a web form that contains an imagebutton and several text boxes.

i want to give focus next textbox, when user change the current textbox text like TAB button does.

i wrote code for textboxes textchange event. But the problem is each time i change text for any textbox and Press Enter, image button runs as if image button takes focus,when i press ENTER.

 

Thanks for any idea.

Suzan

:confused:

Posted
On pressing the enter, you can use javascript to check the other text boxes if they are filled, if not, then dont submit the form, but focus to the next empty box. Or you can add code to the onKeyDown, onKeyPress, or onKeyUp events in javascript, then you can check for the 'which' property, this will return the ASCII name of the key that was pressed.
  • *Experts*
Posted

If I understand correctly, you are trying to change the focus of

the textboxes with the Enter key instead of Tab. This cannot be

done with ASP.NET on the server side, because the visual display

of the webpage is determined by the client application (the user's

web browser). You will need to use JavaScript or VBScript, like

kahlua001 mentioned, to accomplish this.

 

Also, if you have AutoPostBack set to True on the TextBox control,

the TextChanged event only fires when the textbox loses focus.

If AutoPostBack is false, then the event fires when the form is

posted to the server.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...