Skip to content

Commit 96fef5d

Browse files
authored
Merge pull request #139 from andrelaszlo/ajaxtype
Added support for selecting ajax request method.
2 parents 8fe28f3 + f36fcdb commit 96fef5d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/jqBootstrapValidation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@
737737
return {
738738
validatorName: name,
739739
url: $this.data("validation" + name + "Ajax"),
740+
ajaxType: $this.data("validation" + name + "Type"),
740741
lastValue: $this.val(),
741742
lastValid: true,
742743
lastFinished: true
@@ -747,6 +748,8 @@
747748
return validator.lastValid === false;
748749
}
749750

751+
var ajaxType = validator.ajaxType || 'GET';
752+
750753
if (validator.lastFinished === true) {
751754
validator.lastValue = value;
752755
validator.lastValid = true;
@@ -755,6 +758,7 @@
755758
url: validator.url,
756759
data: "value=" + encodeURIComponent(value) + "&field=" + $this.attr("name"),
757760
dataType: "json",
761+
type: ajaxType,
758762
success: function (data) {
759763
if ("" + validator.lastValue === "" + data.value) {
760764
validator.lastValid = !!(data.valid);

0 commit comments

Comments
 (0)