Contact form plugin - highlights fields with errors
Created 5 years ago by machinedean

Hi there,

We've been using your contact form plugin recently and one piece of feedback we've had is that it would be ideal that when validation fails that this is indicated on the screen to the end user. Ideally, a class would be applied to the field so we could highlight that and make more obvious!

Thought I'd share, it would make a big difference to contact forms that have a fair number of fields!



ryanthompson  —  4 years ago Best Answer

Depending on how you display the form they should indeed be classed. However if you use manual output like {{|raw }} for example you will need to add this yourself like this:

<div class="{{ form.hasError('field_slug') ? 'has-error' }}">

However that should be happening in the default field wrapper already: