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:
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!
Safe swoops
Sangiro
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!
Safe swoops
Sangiro