ולדציה למספרי טלפון בטפסי אלמנטור
Tue May 18 2021 20:39:31 GMT+0000 (UTC)
Saved by
@Shesek
// Elementor Form Telephone Number Validition
//======================================
add_action( 'elementor_pro/forms/validation/tel', function( $field, $record, $ajax_handler ) {
// Match this format XXXXXXXXXX, 1234567890
if ( preg_match( '/[0-9]{10}/', $field['value'] ) !== 1 ) {
$ajax_handler->add_error( $field['id'], 'הזן טלפון חוקי ללא מקף או רווח' );
}
}, 10, 3 );
content_copyCOPY
Comments
@miri - Wed Oct 20 2021 09:45:40 GMT+0000 (UTC)Hey, I used this code and it's work perfect just one thing I want limit the phone number untill 10 numbers now I can type more than 10 numbers and the form is send what do I have to add the code to limit the numbers to 10? thanks