Because we use orbeon xforms, we don’t know the id of the button tag.
What we would like is the Enter key to trigger a button that contains a certain string value.
If my form contains a Check button like so:
<button id"random">Check</button>
I would like my javascript button to trigger it with something like:
find the button that has value “Check” and click it when Enter is pressed.
Updated code, since I didn’t see your markup (which contained
<button>instead of<input>)I would use JQuery here since selecting the buttons you are looking for could be more difficult using Pure JS only.
Something like this should work:
With markup like this:
See Demo : http://jsfiddle.net/giddygeek/Caxae/3/
(Click/Focus on the result pane and hit the Enter key)