How to make a button to be clicked when enter is pressed using bookmarklet?

378 Views Asked by At
<td align="center" width="100%">
                        <input type="button" value=" Next " id="validate"><a id="new:new" href="#" onclick="mojarra.jsfcljs(document.getElementById('Form'),{'Form:Proceed':'Form:Proceed'},'');return false"></a>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="Form:reset" type="submit" name="Form:reset" value="Reset">
                    </td>

This is the code above. I just want that after filling up the previous text field, when I press enter, the "Next" button gets clicked. Here "Reset" button is assigned as SUBMIT.

Please show me the javascript code using bookmarklet.

1

There are 1 best solutions below

0
On

IF what I think you want is to: have the code click the Submit button when the bookmarklet is clicked, the code I made below will do just that for you.

I URI encoded it for you so there shouldnt be any problems.

javascript:(function()%7Bdocument.getElementById(%22Form%3Areset%22).click()%7D)()