BUGFIX Choose first "action" button on submission of CMS forms via enter key, to avoid a form field button being autoselected (fixes #7151)

This commit is contained in:
Ingo Schommer 2012-04-30 17:13:39 +02:00
parent 517a0c9e48
commit 85a331cc11

View File

@ -147,6 +147,16 @@
return false;
},
onkeydown: function(e) {
if(e.which == 13) {
// Submit the form with the first action button if enter key is pressed.
// Avoids browsers auto-selecting the first button available,
// which might be on a form field, e.g. an UploadField popup trigger.
var btn = this.find('.Actions .action:first');
this.trigger('submit', e, btn);
}
},
/**
* Function: validate
*