Page is a not externally linkable
nelsonm - 7:16 pm on Jul 2, 2012 (gmt 0)
[edited by: alt131 at 12:20 pm (utc) on Jul 7, 2012]
hi all,
I've been struggling with binding a jquery click method to a specific button in a jquery dialog because i can't get the selector right.
I want to specifically target all jquery dialog submit buttons. I have the following selector set up that works for the first button in the buttonset but the submit button is not always the first button in the set.
$('body').on('keypress', '.ui-dialog', function(event) {
if (event.keyCode === $.ui.keyCode.ENTER) {
$(this).find('.ui-dialog-buttonpane button:first').click();
return false;
}
});
but i can't get it to work for the following jquery dialog buttonset. Can anyone help me out?
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<div class="ui-dialog-buttonset">
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
type="button" role="button" aria-disabled="false">
<span class="ui-button-text">Print Work Order</span>
</button>
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
type="button" role="button" aria-disabled="false">
<span class="ui-button-text">Submit</span>
</button>
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
type="button" role="button" aria-disabled="false">
<span class="ui-button-text">Cancel</span>
</button>
</div>
</div>
[edit reason] Side Scroll [/edit]