Onfocus for a textbox and button

D

Do

Hi,

When a user puts the focus(cursor) into a particular textbox on my page,
I want the button to have focus once the user presses the return key.
Right now, nothing happens when the user presses the return key.

Do
 
C

Chris Jackson

Using JavaScript, you can trap the OnKeyPress event of the document, and
then call a function that checks for window.event.keyCode == 13, in which
case you can set the focus to whatever control you want to.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top