Populate has-error class automatically