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() .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'); module.debug('Enter key pressed, submitting form');
$submit $submit
.addClass(className.down) .addClass(className.down)
@ -633,6 +633,7 @@ $.fn.form.settings = {
message : '.error.message', message : '.error.message',
field : 'input, textarea, select', field : 'input, textarea, select',
group : '.field', group : '.field',
checkbox: 'input[type="checkbox"], input[type="radio"]',
input : 'input', input : 'input',
prompt : '.prompt', prompt : '.prompt',
submit : '.submit' submit : '.submit'

Loading…
Cancel
Save