It took 2 minutes to find out it's just a PHP snippit but it works like a charm so I'm very grateful thank you EZ.
@realbillsmithАй бұрын
Perfect fix to my Elementor form. Needed exactly this to stop phone numbers without area codes. Thank you!
@ezwp4uАй бұрын
Hey! 🙂 You're very welcome! I am so happy to hear this video was able to solve a problem you were facing! 🤩 See you in the next one! ✌🏼
@thewebstylist15 күн бұрын
GENIUS and solved an issue we've had for days!! BIG UPS SIR!
@Bjoerk_Media2 ай бұрын
Great, exactly what I needed. Thanks for making and sharing!
@ezwp4u2 ай бұрын
Hey! 🙂 You're very welcome! I am so happy to hear that this video was exactly what you needed and I was able to help you! 🙏 See you in the next one! ✌🏼
@experiencemedia11482 ай бұрын
Thanks, this is great. Are you able to show how to validate more than one field in the form?
@ezwp4u2 ай бұрын
Hey! 🙂 I would love to do that, do you have any specific fields you would want to see? 🤔
@hannoushy58324 күн бұрын
Thanks, but the website that has the code is down. it gives 403 Forbidden error.
@Bubinikola26 күн бұрын
any idea how to make it work on a landing page? it works on the website, but not on the landing page I'm advertising
@nargisfakhree3 ай бұрын
Thank you so much you are legend
@ezwp4u3 ай бұрын
Hey! 🙂 You're very welcome! I highly appreciate your warm words - it means a lot to me! 🙏 See you in the next video! ✌🏼
@webqodaАй бұрын
Great bro it works well but the link you provided for the code that is broken well thankyou....
@ezwp4uАй бұрын
Hey! 🙂 I am sorry to hear that the link is broken. 🙏 This is the code: function validate_phone_number( $field, $record, $ajax_handler ) { if ( ! empty( $field['value'] ) && strlen( $field['value'] ) !== 10 ) { $ajax_handler->add_error( $field['id'], 'Phone number must be exactly 10 digits long.' ); } } add_action( 'elementor_pro/forms/validation/tel', 'validate_phone_number', 10, 3 ); Other then that, I'll fix the link, thank you! See you in the next video! ✌🏼
@habibj4 ай бұрын
Do you know whether there is an email form validation code?
@floralightlyАй бұрын
function validate_email_address($field, $record, $ajax_handler) { // Check if the email field is not empty if (!empty($field['value'])) { // Validate the email format using PHP's built-in filter if (!filter_var($field['value'], FILTER_VALIDATE_EMAIL)) { // Add an error if the email format is invalid $ajax_handler->add_error($field['id'], 'Please enter a valid email address.'); } else { // Extract domain from the email list(, $domain) = explode('@', $field['value']); // Check if the domain has a valid MX record (email server) if (!checkdnsrr($domain, 'MX')) { // Add an error if the domain has no valid MX record $ajax_handler->add_error($field['id'], 'Please enter a valid email address.'); } } } } add_action('elementor_pro/forms/validation/email', 'validate_email_address', 10, 3);
@PranjaliShejulАй бұрын
It's not working... Is there a need to add something on the elementor form ?
@Rishivworld2806Ай бұрын
I can't find the code
@ezwp4uАй бұрын
Hey! 🙂 You can find the code in the first comment you left, I have pasted the code in the answer ✌🏼
@jl10902 ай бұрын
Tried several times it didnt' work. Anoy suggestions.
@ezwp4u2 ай бұрын
Hey! 🙂 I am sorry to hear you have tried several times and it didn't work for you. Could you elaborate what you've tried exactly (including the exact steps) so I could assist you better? 🧐
@Rishivworld2806Ай бұрын
Please share code
@ezwp4uАй бұрын
Hey! 🙂 Here is the code: function validate_phone_number( $field, $record, $ajax_handler ) { if ( ! empty( $field['value'] ) && strlen( $field['value'] ) !== 10 ) { $ajax_handler->add_error( $field['id'], 'Phone number must be exactly 10 digits long.' ); } } add_action( 'elementor_pro/forms/validation/tel', 'validate_phone_number', 10, 3 );
@jananibalu69492 ай бұрын
Use this code: function validate_phone_number($field, $record, $ajax_handler) { if (!empty($field['value']) && strlen($field['value']) !== 10) { $ajax_handler->add_error($field['id'], 'Phone number must be exactly 10 digits long'); } } add_action('elementor_pro/forms/validation/tel', 'validate_phone_number', 10, 3);
@ezwp4u2 ай бұрын
Hey! 🙂 Yup, this is the code 💪🏻
@HarunShekh-x9o2 ай бұрын
Link is not working
@ezwp4u2 ай бұрын
Hey! 🙂 I see, here is the code: function validate_phone_number( $field, $record, $ajax_handler ) { if ( ! empty( $field['value'] ) && strlen( $field['value'] ) !== 10 ) { $ajax_handler->add_error( $field['id'], 'Phone number must be exactly 10 digits long.' ); } } add_action( 'elementor_pro/forms/validation/tel', 'validate_phone_number', 10, 3 );
@k.h.a.l.e.d5 ай бұрын
i can't find the code !
@ezwp4u5 ай бұрын
Hey! 🙂 You can find the code in the following link - bit.ly/4budTPu