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:


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 thejh

Here's a pull request for this:

However, I was told that this feature will not immediately be pulled.

comment:2 Changed 10 years ago by Scott González


comment:3 Changed 10 years ago by petersendidit

Status: newopen
Summary: Default buttons in dialogsDialog: Default buttons in dialogs

comment:4 Changed 10 years ago by Jörn Zaefferer

You probably should use a form inside the dialog and run the necessary action on submit.

comment:5 Changed 10 years ago by Scott González

Resolution: patcheswelcome
Status: openclosed

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.