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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a PRESS KEY event, when a Key is Pressed... something happens!

Status
Not open for further replies.

seba070707

Programmer
Joined
Aug 6, 2001
Messages
13
Location
AR
Hello.

I need a PRESS KEY event, when a Key is Pressed... something happens!

For example, when I press Enter, for example... a Form is sent.

THANKS.
 
hie
a simplest example: works in ie
function func(){
alert('a key was pressed')
}

<body onkeypress=&quot;func()&quot;> Victor
 
a form usualy uses the &quot;submit&quot; thinga... for example

<form name=&quot;frm&quot; action=&quot;javascript:alert('form action')&quot;>
<input type=&quot;text&quot;>
<input type=&quot;submit&quot; value=&quot;Submit form&quot;>
</form>

this is (my opinion) the best way!! but if you want to enable the user to press return in a combobox, then you must add more code :-)

have one ready if you need!! (a simple, but effective one (I hope...)) My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top