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

update button functionality on enter key

Status
Not open for further replies.

arravalli12

Programmer
May 3, 2005
62
US
I have a form with one text box field and one label. Also there is update button and reset button. When you enter some value in text box, the update button is highlighted.
When you hit enter button instead of clicking update button - It does not do anything. But works good if you click update button.
How to make use of enter button as clicking update button?
 
one way:
using Javascript:

<script type="text/javascript">
function login() {
if(event.keyCode == 13) {
alert("You hit enter!");
}
</script>

second way:

By default web browsers submit forms with the enter key as long as there is an input of type submit on the form.

i mean...use this for your textbox in form

<input type="submit" value="yourvalue">

-DNG

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top