WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7 Phone Module
[resolved] how to change the inputfield? (2 posts)

  1. kletskater
    Member
    Posted 1 year ago #

    hi, i want to change the inputfield for:
    4 digits for country code, 3 or 5 digits area code, and 7 or 5 digits subscriber number.
    Wonder if that is possible?
    Link to my CF

    http://wordpress.org/extend/plugins/contact-form-7-phone-mask-module/

  2. Gabriel Reguly
    Member
    Plugin Author

    Posted 1 year ago #

    Hi ketskater,

    As said at Description

    Currently the masking options are hard coded at file jquery.maskedinput-1.3.1.js, future version will address this.

    That said, change it at your own risk:

    (function($) {
    	$('.phone').mask('(99)9999-9999', { toggleMask: { alternateMask: '(99)999-999-999', erTrigger: '\\(11\\)9+', erUndo: '^(?!\\(11\\)9+)' } } );
    })(jQuery);

    mask (99) 9999-9999 is the initial mask
    alternateMask: (99)999-999-999 is the optional mask
    erTrigger: \(11\)9+ regular expression that will change to the alternate mask
    erUndo: ^(?!\(11\)9+) regular expression that will change back to the initial mask

    Regards,
    Gabriel

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic