330 Locust Dr.
Verona, WI 53593
Powderkeg Web Design
Message Us

Web Dev Tid Bit (WDTB): Adding Custom Classes to Gravity Forms Confirmation and Validation Messages

August 04, 2017

Gravity Forms has filters to allow you to customize the validation and confirmation messages of your forms. If you are using a Bootstrap framework and want to style the messages like alerts, you can use these pieces of code to accomplish that.

Validation Error:

This takes the default validation code and adds the alert and alert-danger class to them via the “gform_validation_message” filter. You could also change up the message itself and be selective on which form you want it to be changed for by putting in logic to determine what $form[‘id’] you are working with.

Confirmation Message:

Similar to the validation error filter above, this wraps the default confirmation in a div with the alert and alert-success Bootstrap classes.

Lead Developer

Nick is an ambitious and versatile developer with a wide range of talents. He is an efficient coder that utilizes his resources in order to achieve both his and the clients’ goals. His Alma Mater is the University of Wisconsin – Stevens Point where he graduated with honors in Web and Digital Media Development.