• Resolved mirazhyk

    (@mirazhyk)


    Hello!
    I have a site with CF7 and want to set phone mask on page https://talisman-kyiv.net.ua/timelist/

    +38 (0__) ___ - __ - __

    Ukrainian phone numbers

    CF7 code

    <div class="twr_form_box">
    			
    			[tel* tel-706 class:form-control class:tel-new  size:119 placeholder "+38 (0__) ___-__-__" ]
    
    		
    
    		</div>

    A add script

     $(".tel-new").mask("+38 (0__) ___-__-__");

    But it doesn’t work.
    Can anybody helps with phone mask?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mirazhyk

    (@mirazhyk)

    If i try to add code in functions.php

    function talisman_custom_masks_form_fields() {
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function($){
                $("input.tel-new").mff_mask('+380__ ___-__-__');
                       });
        </script>
        <?php
    }
    
    add_action('wp_footer', 'talisman_custom_masks_form_fields', 111);
    <div class="twr_form_box">		
    	[tel* tel-706 class:form-control class:tel-new  size:16 placeholder "+380__ ___-__-__" ]
     </div>

    it doesn’t work too.

    Plugin Author Petermann

    (@ivanpetermann)

    Hi @mirazhyk

    Try using the code below.

    jQuery('input.tel-new').mff_mask('+38(X00) 000-00-00', {
        translation: { 'X': { pattern: /[0]/, optional: false, fallback: '0'}},
        placeholder: "+38(0__) ___-__-__"
    });
    Thread Starter mirazhyk

    (@mirazhyk)

    form field code

    <div class="twr_form_box">		
    [tel* tel-706 class:form-control class:tel-new  size:16]
    <div>

    in functions.php

    function talisman_custom_masks_form_fields() {
        ?>
        <script type="text/javascript">
            jQuery('input.tel-new').mff_mask('+38(X00) 000-00-00', {
                translation: { 'X': { pattern: /[0]/, optional: false, fallback: '0'}},
                placeholder: "+38(0__) ___-__-__"
            });
        </script>
        <?php
    }
    
    add_action('wp_footer', 'talisman_custom_masks_form_fields', 111);

    https://prnt.sc/t4GS57nRD5KN doesn’t work

    Plugin Author Petermann

    (@ivanpetermann)

    Hi?@mirazhyk

    The test conducted directly on the website link provided initially worked correctly.

    Can you provide more details about why it didn’t work for you?

    Thread Starter mirazhyk

    (@mirazhyk)

    I think it looks another)))
    I’m wrong, I’m sorry.
    Thank You)
    5 stars from me)))

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘phone mask in CF7’ is closed to new replies.