I need to check for mobile checkbox and then show radius text box is required
<?php
/**
* Each field type has its own validation filter,
* so we create a function for each type
*/
add_filter( 'wpcf7_validate_text', 'custom_email_confirmation_validation_filter', 20, 2 );
function custom_email_confirmation_validation_filter( $result, $tag ) {
if ( 'radius' == $tag->name ) {
$mobile = isset( $_POST['services1'] ) ? trim( $_POST['services1'] ) : '';
if ( $mobile == "MOBILE" ) {
$result->invalidate( $tag, "Radius field is required" );
}
}
return $result;
}
?>