Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shortcut key for a button - is it possible? 1

Status
Not open for further replies.

peterv12

Technical User
Dec 31, 2008
108
US
I'm wondering if there's a way to code a shortcut key to perform the same action as a form button being clicked. I know it can be done in VB, but I don't know about PHP. Simply put, I'd like to be able to perform the same action by clicking a button, or by hitting a key combination.
 
PHP cannot interact with the the client browser. Its a server side language which means PHP is not running once the page is loaded.

I suppose you could catch the key presses with VB script or Javascript and submit the form accordingly.

Then PHP can process the form.






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Look at the possibilities in HTML. The input element can have an accesskey attribute that let you define a hotkey:
Code:
<input type="textbox" values="" accesskey="t">
Just make PHP output such constructs.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Phil, thanks for the note about PHP.

Don, thanks for the tip about the accesskey function in HTML, it's just what I was looking for.
Peter V.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top