I have a number of visualforce forms. When I hit the enter key while filling out the forms it clears out all form fields. Is there a way I can globally detect if the enter key has been clicked and fire an action function which submits my form vis my submit function or does every single input field require an onKeypress listener?
i basically want to stop my form fields from being cleared when they should not be when an enter key is clicked. My form submit function in my controller is not called, it just clears the fields.
Any tips on this woule be very much appreciated. It applies to a number of forms so could be an issue in general.
If I could disable the enter key function it might help but I'm guessing for accessiblity that is not a good approach.
Is there a way in Salesforce visualforce forms to detect if an enter key has been pressed in any apex:inputField on the form?
Thanks.