I have a button that fires an onlclick event. In the event the button updates some field values and then does a form.submit. The problem I am having in Firefox is when I navigate down a column using the enter key (on the keyboard) along with event.keycode the button I set up fires the submit. This only happens in firefox it is fine in IE. Is there any way to prevent the button from being executed when hitting the enter key.
Is there any way to prevent the button from being executed when hitting the enter key.
Yes, but this would limit me and other users who don't use a mouse. I wouldn't recommend it, but there is code to do it. Someone should have it here. I've no time to look it up.
A principal rule of usable design is that you shouldn't mess with the users' expectations, and pressing enter to submit the form is fairly standard. If you are concerned about his, add validation or confirmation so that users pressing enter too early don't suffer from their mistake.
Adam
"If you’re not using valid HTML, then you haven’t created a Web page. You may have created something else, but it isn’t a Web page." - Joe Clark
Personally I wouldnt be worried about those few people that dont use a mouse. Cant conform to everyones needs, so rule of thumb, conform to the majority.
cthrow, I assume that you intend giving up visiting the web if you ever go blind or suffer some other injury that stops you from being able to use the mouse because if web pages are built following your suggestion then you will not be able to access them in that situation.
Web pages should be designed so that all visitors can access them. The only exception should be restrictions relating to the actual subject matter of the page.
Bookmarks