hey there,
i want a class named fullname to validate if it has Hebrew or English characters. will this code do it:
if ( strpos( $field->cssClass, 'fullname' ) === false ) {
continue;
$pattern = "/^(?!.*\s\s)"
. "(?!.*\.\.)"
. "(?!.*,,)"
. "[א-תA-Z][א-תa-zA-Z .,]{2,256}$/";
if (preg_match($pattern, $field->cssClass)) {
$result['is_valid'] = false;
$result['message'] = empty( $field->errorMessage ) ? __( 'אותיות בעברית/English Characters', 'gravityforms' ) : $field->errorMessage;
} else {
$result['is_valid'] = true;
$result['message'] = '';
}
return $result;
}, 10, 4 );