Gravity Forms: Add class to body after submission

With this small code snippet, a class is added to the <body> tag of your page once a Gravity Form has been submitted. I used this code so I could hide some other elements on a contact page after form submission via CSS.

This does not work with ajax forms, sorry.