Browse Source

Fixes checkboxes not to submit form on enter

pull/912/head
jlukic 10 years ago
parent
commit
d95a163cc8
1 changed files with 2 additions and 1 deletions
  1. 3
      src/behaviors/form.js

3
src/behaviors/form.js

@ -150,7 +150,7 @@ $.fn.form = function(fields, parameters) {
.blur()
;
}
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) ) {
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).size() > 0 ) {
module.debug('Enter key pressed, submitting form');
$submit
.addClass(className.down)
@ -633,6 +633,7 @@ $.fn.form.settings = {
message : '.error.message',
field : 'input, textarea, select',
group : '.field',
checkbox: 'input[type="checkbox"], input[type="radio"]',
input : 'input',
prompt : '.prompt',
submit : '.submit'

Loading…
Cancel
Save