Home › Forums › Quform WordPress › Normal Phone Mask › Reply To: Normal Phone Mask
1. Yes, I saw it, tell me for my mask, what is the correct regular expression to check +1 (000) 000-00-00? I think the reason is not sending a regular expression.
<abbr title=”HyperText Markup Language”>
add_filter(‘quform_element_valid_1_3’, function ($valid, $value, Quform_Element_Field $element) {
if ( ! preg_match(‘/^\(\d{3}\) \d{3}\-\d{4}$/’, $value)) {
$element->addError(‘Enter a phone number in the format (000) 000-0000’);
$valid = false;
}
return $valid;
}, 10, 3);
</abbr>
2. How do I send the value from this field also in the same mask? That is, so that it is not +1000000000, but +1 (000) 000-00-00?
3. And a big request to suggest how you can add the sender’s city when sending the form (naturally determined by the ip address)?