Gossamer Forum
Home : General : Internet Technologies :

Javascript Question - onclick alternative

Quote Reply
Javascript Question - onclick alternative
I have a small piece of JS on a page. It includes a function called startSearch. Typical form with a field and an input button. The input in the form however does not call a script, it calls this JS function on the page. I'm using the input line below:

Code:
<input" type="Button" value=Go onclick="startSearch()">

With this when I enter a value in the field and click on the "Go" button all works well. However, when I enter a keyword to search and hit the "Enter" key (not click a button) it does nothing.

How can I modify this input statement to catch both the button click and a hit of the enter key?

As you can guess I know nothing about JS. Hope this makes sense! Crazy

Safe swoops
Sangiro
Subject Author Views Date
Thread Javascript Question - onclick alternative sangiro 7613 Jun 14, 2004, 1:34 PM
Post Re: [sangiro] Javascript Question - onclick alternative
cornball 7301 Jun 14, 2004, 3:44 PM
Thread Re: [sangiro] Javascript Question - onclick alternative
brewt 7294 Jun 14, 2004, 5:55 PM
Post Re: [brewt] Javascript Question - onclick alternative
sangiro 7289 Jun 15, 2004, 4:43 AM