You need to sign in to do that
Don't have an account?
Cindy Norman
Totally disable ENTER button
I don't ever want my ENTER button to do anything.
Does anyone know how to disable it without having to put an onkeypress type event on each input field?
I have about 200 input fields of various types (inputField, inputText, radio buttons, ...)
and some commandButtons that i want them to specifically Push to fire.
Does anyone know how to disable it without having to put an onkeypress type event on each input field?
I have about 200 input fields of various types (inputField, inputText, radio buttons, ...)
and some commandButtons that i want them to specifically Push to fire.
So, two answers. =)
Official - you're looking at the onkeypress per field: http://developer.force.com/cookbook/recipe/submit-a-form-with-the-enter-key
Unofficial - you could use some jQuery on/live handlers to bind to the onkeypress by class (just add a classname to all input fields) and cancel the enter key that way?
There is an "onkeypress" attribute for apex:form, but I haven't played with that so I'm not sure if it'll work. (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_form.htm)
For the jQuery route, you'd be looking at something like this:
Give that a whirl - see if that works.