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!

how to make a button work for key board enter to

Status
Not open for further replies.

ABJ

Technical User
Aug 29, 2000
16
AU
Hey
I have made a page with a one-line text box and a push button and it works good but i would like to to work for enter on the keyboard to.
Thanks in advance
Al

here is my code if it help anyone

____________________________________________________________

<html>

<head>
<title></title>
<style type=&quot;text/css&quot;>
<!--

A:link {text-decoration: none;}
A:visited {text-decoration: none;}
A:hover {text-decoration: underline overline; overline; color:navy;}

-->
</style>
</head>

<body>

<form name=&quot;bulletin&quot;>
<div align=&quot;center&quot;><center><p>&nbsp;</p>
</center></div><div align=&quot;center&quot;><center><p>&nbsp;</p>
</center></div><div align=&quot;center&quot;><center><p>&nbsp;</p>
</center></div><div align=&quot;center&quot;><center><p>&nbsp;</p>
</center></div><div align=&quot;center&quot;><center><table border=&quot;0&quot; cellpadding=&quot;4&quot;
cellspacing=&quot;0&quot; width=&quot;38%&quot;>
<tr>
<td width=&quot;52%&quot;><strong><font face=&quot;Arial&quot;><font color=&quot;#FFFFFF&quot;>&nbsp;&nbsp;</font><font
color=&quot;#000000&quot;> 1. &nbsp; Enter Bulletin Number </font><p><font color=&quot;#000000&quot;>&nbsp;&nbsp;
2.&nbsp; Click the go button</font></p>
</font></strong><div align=&quot;center&quot;><center><p>&nbsp;&nbsp;&nbsp;&nbsp; <input type=&quot;text&quot;
name=&quot;number&quot; size=&quot;10&quot;>&nbsp;&nbsp; <input type=&quot;button&quot; value=&quot; Go &quot;
onClick=&quot;grasppasswd()&quot;></td>
</tr>
</table>
</center></div><div align=&quot;center&quot;><center><table border=&quot;0&quot; cellpadding=&quot;0&quot;
cellspacing=&quot;0&quot; width=&quot;1%&quot; height=&quot;1&quot;>
<tr>
<td width=&quot;100%&quot; align=&quot;center&quot; height=&quot;1&quot;><topmargin=&quot;10000&quot; leftmargin=&quot;10000&quot; vlink=&quot;#FFFFF&quot; alink=&quot;#FFFFF&quot;></td>
</tr>
</table>
</center></div><div align=&quot;center&quot;><center><p><script language=&quot;JavaScript&quot;><!--
//-
function grasppasswd() {
var keyword=document.forms.bulletin.number.value
var pagename = keyword + &quot;.htm&quot;
this.location.href = pagename;
}
// -
// --></script></p>
</center></div>
</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top