• We are available for any Development work:
  • Email us at: programmer_heart@yahoo.com

How to show Validation error as popups in Gravity Form in wordpress

To do this open your functions.php file and paste the following code:

add_filter( 'gform_validation_message', 'sw_gf_validation_message', 10, 2 );
function sw_gf_validation_message( $validation_message ) {
add_action( 'wp_footer', 'sw_gf_js_error' );
function sw_gf_js_error() { ?>
<script type="text/javascript">
alert( "Oops, you must have forgotten something...fields marked with a * are required!" );
<?php } ?>

You can change the error message by modifying what is inside the alert () function.

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

Press Enter to Search