Opened 12 years ago
Closed 10 years ago
#6813 closed feature (patcheswelcome)
Dialog: Default buttons in dialogs
Reported by: | famlam | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.10.0 |
Component: | ui.dialog | Version: | 1.8.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
It would be nice if it would be possible to set the default button (the one that will be pressed when you press 'enter') for a dialog button. For example
$( ".selector" ).dialog( "option", "buttons", [
{
text: "Ok", isDefault: true, click: function() { $(this).dialog("close"); }
}
] );
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 10 years ago by
Milestone: | 1.9.0 → 1.10.0 |
---|
comment:3 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Default buttons in dialogs → Dialog: Default buttons in dialogs |
comment:4 Changed 10 years ago by
You probably should use a form inside the dialog and run the necessary action on submit.
comment:5 Changed 10 years ago by
Resolution: | → patcheswelcome |
---|---|
Status: | open → closed |
This actually seems very error prone to implement without just doing what Jörn suggests, and I'd rather not throw a form around user content. I'll close as patcheswelcome in case someone can think of a sane way to implement this.
Note: See
TracTickets for help on using
tickets.
Here's a pull request for this: https://github.com/jquery/jquery-ui/pull/178
However, I was told that this feature will not immediately be pulled.