How can I activate a specific button (containing a script) by pressing enter in the

Cifru

New member
HTML Input BOX? I would like to know how I can activate a button (which is not a Submit button, but contains a script), by pressing Enter a input box. In other words, I would like users to have two options.

The first one by pressing the button I would like them to press (In this case called 'Go'), the second one (my problem) is that they can press enter and activate the same button 'Go'.

From searching on the web the best I found was including the following code in the <input>

onkeyup="if(event.keyCode == 13)

to be included like this

<input name="code" type="text" onkeyup="if(event.keyCode == 13)

but I do not know how to continue it the onkeyup="if(event.keyCode == 13)

I would like to be able as some one presses enter, in the above text box, it would be equivalent as the form users clicked the following button 'Go':

<input name="submitButton" onclick="redirectURL();" type="button" value="Go" />

Kindly note that the type="button" cannot be changed to type="submit" or else the onclick="redirectURL();" will not work.

Thank you in advance
 
Back
Top