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

About Buttons In HTML

Status
Not open for further replies.

iooo

Programmer
Dec 27, 2000
31
CA
Hi,
I wanted to know how to make a button active on clicking "Enter Key" rather than using the mouse

thanks
 
Hi,
i wanted to know how to activate a client script on key board click of enter key rather than using the mouse .
my code is

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function submit1_onclick() {
alert(&quot;wait:&quot;)
FORM1.d

}

//-->
</SCRIPT>
</HEAD>
<BODY>
<P>&amp;nbsp;</P>
<P>
<FORM action=&quot;hello.asp&quot; id=FORM1 method=post name=FORM1>
<P>&amp;nbsp;</P>
<P>

<INPUT id=text1 name=text1 style=&quot;LEFT: 10px; TOP: 19px&quot; CHECKED>
<INPUT type=&quot;submit&quot; value=&quot;Submit&quot; id=submit1 name=submit1 LANGUAGE=javascript onclick=&quot;return submit1_onclick()&quot;>
</P>
</FORM>
<P></P>
</BODY>
</HTML>

but this code workks by clicking the submit button using mouse and when enter key is used it goes to another page
some one please answer the question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top