Call
608.845.2900
Visit
330 Locust Dr.
Verona, WI 53593
Message
info@powderkegwebdesign.com
Powderkeg Web Design
Menu
Message Us
Nick
Nick

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.

Nick
Nick
Senior 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.