Created
June 12, 2013 08:33
-
-
Save masaedw/5763707 to your computer and use it in GitHub Desktop.
data-val-remoteでAdditionalFieldsを設定したときにラジオボタンの値が正しくとれてない
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adapters.add("remote", ["url", "type", "additionalfields"], function (options) { | |
var value = { | |
url: options.params.url, | |
type: options.params.type || "GET", | |
data: {} | |
}, | |
prefix = getModelPrefix(options.element.name); | |
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { | |
var paramName = appendModelPrefix(fieldName, prefix); | |
value.data[paramName] = function () { | |
return $(options.form).find(":input[name='" + escapeAttributeValue(paramName) + "']").val(); | |
}; | |
}); | |
setValidationValues(options, "remote", value); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.val() だとだめで、ラジオボタンのときは :checked でフィルタしないといけないはず