Add class on the form element if there's an error and style it

Feature #2097 in the forge.