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

  1. kletskater
    Posted 3 years 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


  2. Gabriel Reguly
    Plugin Author

    Posted 3 years 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+)' } } );

    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


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Phone Module
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic