Using Enter instead of TAB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itnassol
Forum Newbie
Posts: 2
Joined: Wed Jul 16, 2008 10:28 am

Using Enter instead of TAB

Post by itnassol »

Hi Guys,

I have a screen with a lot of text boxes on for the user to fill in, this is an online version of a very old databse they used to use. In the old Access DB they used to hit the enter button to move between fields.

Is it possible to capture the enter button using PHP and MySQL to make it feel like the old system for them.

cheers

Andrew
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Using Enter instead of TAB

Post by ghurtado »

itnassol wrote: Is it possible to capture the enter button using PHP and MySQL to make it feel like the old system for them.
Since PHP runs on the server side, and the Enter key is pressed on the client side, no, you can't do that.

But you can capture the pressing of any key on the client side with Javascript and go about it that way. You would also have to cancel the submission of the form, since in a lot of browsers pressing the enter key submits the form by default, unless you are in a textbox like this one ;)
Post Reply