Created
May 29, 2014 11:39
-
-
Save muhittin/b6aada3d7c5ed08a1a67 to your computer and use it in GitHub Desktop.
select2 with jquery validation engine fix
This file contains 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
$.each($(".select2-container"), function (i, n) { | |
$(n).next().show().fadeTo(0, 0).height("0px").css("left", "auto"); // make the original select visible for validation engine and hidden for us | |
$(n).prepend($(n).next()); | |
$(n).delay(500).queue(function () { | |
$(this).removeClass("validate[required]"); //remove the class name from select2 container(div), so that validation engine dose not validate it | |
$(this).dequeue(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment