Default action to execute when pressing enter in a form
I've got a jsf 1.2 form with two buttons and several input fields. The first button discards the entered values and repopulates the page with values from a db, the second button saves the entered values. The problem occurs when the user presses enter while the cursor is in one of the input fields, the form gets submitted and the action associated with the first button gets executed. The code looks like this: <h:commandButton action="#{bean.reset}" value="Reset" /> <h:commandButton action="#{bean.save}" value="Save" /> <!-- h:datatable with several h:inputText elements --> Is it possible to