Support is currently limited. Click here to see our hours of operation.

How to modify [error_class]?

Labels

This ticket is public

Notifications

I need to filter/change [error_class] to the Bootstrap 4 class "has-danger".  Any snippets you can share?

Hi,

This hook should do the trick:
https://formidableforms.com/knowledgebase/frm_field_div_classes/

Alternatively, you could take this approach:
https://formidableforms.com/knowledgebase/frm_replace_shortcodes/

You could also change the values in the browser with Java Script by monitoring the class changes to a field when an error is generated, and then replacing those classes with 'has-danger', or some combination of both (depending on which version best fit the desired outcome).

I don't understand how this would help? I need the class to only fire if there is an error. This would just add the class with out any conditions.

Just FYI, I would probably use the frm_field_div_classes hook that Skyler mentioned. I would check if the classes includes 'frm_blank_field'. If it does, then I would add ' has-danger'.

Reply to this Ticket