Forked from cfmitrah/jqueryValidationErrorPlacementSemanticUI.js
Created
January 29, 2017 12:36
-
-
Save mateuszgiza/7647e0e3a3a1f24bf63fe6b36c552f95 to your computer and use it in GitHub Desktop.
jQuery validation error placement for Semantic-UI
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
| jQuery(document).ready(function($) { | |
| $.validator.setDefaults({ | |
| errorClass: 'errorField', | |
| errorElement: 'div', | |
| errorPlacement: function(error, element) { | |
| error.addClass("ui red pointing above ui label error").appendTo( element.closest('div.field') ); | |
| }, | |
| highlight: function(element, errorClass, validClass) { | |
| $(element).closest("div.field").addClass("error").removeClass("success"); | |
| }, | |
| unhighlight: function(element, errorClass, validClass){ | |
| $(element).closest(".error").removeClass("error").addClass("success"); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment