#2417 Possibility to specify dataType for $.ajax call in yii.activeForm.js

This commit is contained in:
Borales
2014-02-13 16:13:22 +02:00
parent f53863d7de
commit a32753b5e5
2 changed files with 9 additions and 2 deletions

View File

@ -45,7 +45,9 @@
// function ($form, attribute, messages)
afterValidate: undefined,
// the GET parameter name indicating an AJAX-based validation
ajaxVar: 'ajax'
ajaxVar: 'ajax',
// the type of data that you're expecting back from the server
ajaxDataType: 'json'
};
var attributeDefaults = {
@ -301,7 +303,7 @@
url: data.settings.validationUrl,
type: $form.prop('method'),
data: $form.serialize() + extData,
dataType: 'json',
dataType: data.settings.ajaxDataType,
success: function (msgs) {
if (msgs !== null && typeof msgs === 'object') {
$.each(data.attributes, function () {