#5343 closed bug (fixed)
Add option to allow form submission when option is chosen
Reported by: | nigel | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.1 |
Component: | ui.autocomplete | Version: | 1.8rc3 |
Keywords: | keyboard | Cc: | |
Blocked by: | Blocking: |
Description
Autocomplete prevents form submission when you choose an item with the Enter key. I can understand how this is desirable in many cases, but I happen to have a case where I'd like to immediately submit the form once an option is chosen. Would it be possible to make this behaviour configurable?
Change History (5)
comment:1 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|---|
Priority: | minor → major |
Resolution: | worksforme |
Status: | closed → reopened |
Type: | feature → bug |
This is a bug. We're changing the semantics of form elements by canceling the event.
comment:3 Changed 13 years ago by
You can't use the change event either, it fires at all sorts of other times.
I only want to control the handling of the enter key. Not submit the form every time the element changed.
comment:4 Changed 13 years ago by
Milestone: | 1.8 → 1.8.1 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Fixed in 1ddd4f5d3f83e1612cdbcf7039d01619b62c8a05.
You can now do:
$( el ).autocomplete({ select: function( event ) { if ( event.keyCode === 13 ) { // handle enter key selection } } });
comment:5 Changed 13 years ago by
Milestone: | 1.9 → 1.8.1 |
---|
Note: See
TracTickets for help on using
tickets.
Use the change event http://docs.jquery.com/UI/Autocomplete#event-change