To do this open your functions.php file and paste the following code:
|
1 2 3 4 5 6 7 8 9 10 |
<?php 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!" ); </script> <?php } ?> |
You can change the error message by modifying what is inside the alert () function.