Page 1 of 1

Using Enter instead of TAB

Posted: Tue Jul 29, 2008 12:23 pm
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

Re: Using Enter instead of TAB

Posted: Tue Jul 29, 2008 12:34 pm
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 ;)