[Jquery validation plugin] bootstrap 필드 오류 표시 옵션

2020. 10. 26. 14:15linux

errorElement: "span",
errorPlacement: function (error, element) {
	error.addClass("invalid-feedback");
	if (element.prop("type") === "checkbox") {
		error.insertAfter(element.parent("label"));
	} else {
		error.insertAfter(element);
	}
},
highlight: function (element, errorClass, validClass) {
	$(element).addClass("is-invalid").removeClass("is-valid");
},
unhighlight: function (element, errorClass, validClass) {
	$(element).addClass("is-valid").removeClass("is-invalid");
}