diff --git a/app/assets/javascripts/utils.js b/app/assets/javascripts/utils.js index 0b99956..edbb656 100644 --- a/app/assets/javascripts/utils.js +++ b/app/assets/javascripts/utils.js @@ -1,7 +1,7 @@ function displayFormErrors(data){ - if( data.errors != undefined ){ - $.each( data.errors, function( field, errorMsg) { - $("#"+field).parents(".control-group").addClass("error"); + if(data.errors != undefined ){ + $.each(data.errors, function(field, errorMsg) { + $("#"+field).closest(".form-group").addClass("has-error"); $("#"+field).siblings(".help-block").html(errorMsg); }); }