Skip to main content

Search and Top Navigation

#6813 closed feature (patcheswelcome)

Opened January 05, 2011 09:57PM UTC

Closed November 19, 2012 01:47PM UTC

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"); }

}

] );

Attachments (0)
Change History (5)

Changed April 11, 2011 03:12PM UTC by thejh comment:1

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.

Changed October 11, 2012 02:47PM UTC by scottgonzalez comment:2

milestone: 1.9.01.10.0

Changed October 15, 2012 06:43PM UTC by petersendidit comment:3

status: newopen
summary: Default buttons in dialogsDialog: Default buttons in dialogs

Changed November 18, 2012 09:07PM UTC by jzaefferer comment:4

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

Changed November 19, 2012 01:47PM UTC by scottgonzalez comment:5

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.