1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-04-04 05:33:22 -04:00
2017-01-26 15:50:24 +06:00

11 lines
363 B
JavaScript

function displayFormErrors(data, form){
if(form){
$(form).find(".form-group.has-error").removeClass("has-error").find(".help-block").html("");
}
if(data.errors != undefined ){
$.each(data.errors, function(field, errorMsg) {
$("#"+field).closest(".form-group").addClass("has-error").find(".help-block").html(errorMsg.join(", "));
});
}
}