number validation
-
Hi,
how I can create a filter to confirmation of no field + as email example below. Number field is called [number* number-479]add_filter( 'wpcf7_validate_email*', 'custom_email_confirmation_validation_filter', 20, 2 ); function custom_email_confirmation_validation_filter( $result, $tag ) { $tag = new WPCF7_Shortcode( $tag ); if ( 'your-email-confirm' == $tag->name ) { $your_email = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : ''; $your_email_confirm = isset( $_POST['your-email-confirm'] ) ? trim( $_POST['your-email-confirm'] ) : ''; if ( $your_email != $your_email_confirm ) { $result->invalidate( $tag, "Are you sure this is the correct address?" ); } } return $result; }http://contactform7.com/2015/03/28/custom-validation/
see e.g. s12.postimg.org/ubsskr8i5/enfold_nr.gif
Hope you can help.
Regards pete,
The topic ‘number validation’ is closed to new replies.