Skip to content

Instantly share code, notes, and snippets.

@muhittin
Created May 29, 2014 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhittin/b6aada3d7c5ed08a1a67 to your computer and use it in GitHub Desktop.
Save muhittin/b6aada3d7c5ed08a1a67 to your computer and use it in GitHub Desktop.
select2 with jquery validation engine fix
$.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