|
|
@ -83,7 +83,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
var settings = $.extend({}, defaults, options || {}); |
|
|
|
var settings = $.extend({}, defaults, options || {}); |
|
|
|
if (settings.validationUrl === undefined) { |
|
|
|
if (settings.validationUrl === undefined) { |
|
|
|
settings.validationUrl = $form.attr('action'); |
|
|
|
settings.validationUrl = $form.prop('action'); |
|
|
|
} |
|
|
|
} |
|
|
|
$.each(attributes, function (i) { |
|
|
|
$.each(attributes, function (i) { |
|
|
|
attributes[i] = $.extend({value: getValue($form, this)}, attributeDefaults, this); |
|
|
|
attributes[i] = $.extend({value: getValue($form, this)}, attributeDefaults, this); |
|
|
@ -291,13 +291,13 @@ |
|
|
|
// If the validation is triggered by form submission, ajax validation
|
|
|
|
// If the validation is triggered by form submission, ajax validation
|
|
|
|
// should be done only when all inputs pass client validation
|
|
|
|
// should be done only when all inputs pass client validation
|
|
|
|
var $button = data.submitObject, |
|
|
|
var $button = data.submitObject, |
|
|
|
extData = '&' + data.settings.ajaxVar + '=' + $form.attr('id'); |
|
|
|
extData = '&' + data.settings.ajaxVar + '=' + $form.prop('id'); |
|
|
|
if ($button && $button.length && $button.attr('name')) { |
|
|
|
if ($button && $button.length && $button.prop('name')) { |
|
|
|
extData += '&' + $button.attr('name') + '=' + $button.attr('value'); |
|
|
|
extData += '&' + $button.prop('name') + '=' + $button.prop('value'); |
|
|
|
} |
|
|
|
} |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: data.settings.validationUrl, |
|
|
|
url: data.settings.validationUrl, |
|
|
|
type: $form.attr('method'), |
|
|
|
type: $form.prop('method'), |
|
|
|
data: $form.serialize() + extData, |
|
|
|
data: $form.serialize() + extData, |
|
|
|
dataType: 'json', |
|
|
|
dataType: 'json', |
|
|
|
success: function (msgs) { |
|
|
|
success: function (msgs) { |
|
|
@ -380,7 +380,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
var getValue = function ($form, attribute) { |
|
|
|
var getValue = function ($form, attribute) { |
|
|
|
var $input = findInput($form, attribute); |
|
|
|
var $input = findInput($form, attribute); |
|
|
|
var type = $input.attr('type'); |
|
|
|
var type = $input.prop('type'); |
|
|
|
if (type === 'checkbox' || type === 'radio') { |
|
|
|
if (type === 'checkbox' || type === 'radio') { |
|
|
|
return $input.filter(':checked').val(); |
|
|
|
return $input.filter(':checked').val(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|