Question T12044
Visible to All Users

how can i change input mask according to the phone number format ?

created 3 years ago

how can i change input mask according to the phone number format ? for example for +91 and +1 , ind and us ?

Code
{           type: "text",           name: "question77",           title: "Phone",           inputMask: "phone",           inputFormat: "(+##)-###-###-####",           placeHolder: "+0-000-000-0000",           validators: [             {               type: "numeric",             },           ],           startWithNewLine: false,         },

Answers approved by surveyjs Support

created 3 years ago (modified 3 years ago)

Hello,
You can try the (+99)-999-999-9999 or (+9)-999-999-9999 inputFormat. 9 is a mask definition for numeric characters. For more information on mask syntax, please refer to Inputmask documentation: Readme.md.

JSON
{ "name": "date", "type": "text", "title": "Date:", "inputMask": "phone", "inputFormat": "(+99)-999-999-9999", "placeholder": "(+99)-999-999-9999" }

Drop me a line if you have any questions.

    Show previous comments (6)

      email is the phone based on that i have to change input format

        is anyone there @surveyjs Support team.

          Hello,
          The inputFormat setting doesn't accept placeholders. If you wish to change the inputFormat of a survey question, you can get a survey question using the survey.getQuestionByName function, and specify the question's inputFormat property as you wish.

          Drop me a line if you have any questions.