How can I create a mask that accepts "+" sign and numbers?

  • Profile Image
    kongyj88
    Asked on January 13, 2016 at 12:28 PM

    hi may i know how to create a phone number field where the users can only enter "+" and other numbers? 

     

    i have tried recreating the phone number field via text box, however it is only able to validate alphabetical, numerical, currency, cyrillic, alphanumeric, email and URL.

     

    i want to create a entry field where users can input "+" sign when they feel like indicating their country code, as well as numerical digits for their phone number input.

     

    Is it possible? anyone know the solution?

     

    Thank you

  • Profile Image
    Carina
    Answered on January 13, 2016 at 03:46 PM

    You can add a phone number field, activate the country code and then add the following css:

     

    #input_1_area {

        display : none;

    }

     

    #sublabel_area {

        display : none;

    }

     

    #cid_1 span.phone-separate {

        display : none;

    }

     

    You can test and clone the demo form:  

    https://form.jotform.com/60126476843963? 

    Let us know if we can assist you further.   

  • Profile Image
    kongyj88
    Answered on January 13, 2016 at 08:41 PM

    Hi Carina,

    thanks for your help but what i wish to create is a single field instead of both country and phone entry field.

    At the same time, i can still submit the form by inputting alphabets and other special symbols for contact form, may i know how to limit the input or create a validation where it just accept "+" and numeric digits?

    thank you.

  • Profile Image
    EltonCris
    Answered on January 14, 2016 at 02:56 AM

    I think there's no available feature in the form builder that allow such validation. However, you can still achieve this when you use your form source code and inject custom script that perform such validation.

    Alternatively, you might want to consider using the International Telephone Picker widget. This has an option to select the country code with + symbol in it.

    Hope this helps!

  • Profile Image
    kongyj88
    Answered on January 15, 2016 at 02:14 AM

    Hi Elton,

     

    Even the international widget also accepts special symbols and alphabets as contact number, which is undesirable.

  • Profile Image
    Carina
    Answered on January 15, 2016 at 06:59 AM

    Unfortunately I believe it is not possible because if you want a numeric validation, then it is not possible to add the + sign. But the + sign can be replaced by 00, or you can add the + sign in the label:

    https://form.jotform.com/60142807512952 

    Let us know if we can assist you further.

  • Profile Image
    kongyj88
    Answered on January 16, 2016 at 08:29 AM

    Hi Carina,

    Is it possible to set max number of character in the field? i think that's the least i can do now.

    Thanks.

     

  • Profile Image
    EltonCris
    Answered on January 16, 2016 at 01:57 PM

    @kongyj88

    Yes, you can set a maximum character limit on a textbox field. You can also change its validation to numeric to accept only digits. Here's how:

    Alternatively, you can also use a Number tool.

  • Profile Image
    kongyj88
    Answered on January 16, 2016 at 07:38 PM

    Hi elton, 

    What about the international telephone picker widget? Am i able to set a max number of characters too?
  • Profile Image
    EltonCris
    Answered on January 17, 2016 at 12:30 AM

    Unfortunately, that widget doesn't have a max limit character option so it is not possible.

    Thanks!

  • Profile Image
    kongyj88
    Answered on January 17, 2016 at 01:55 AM

    Am i able to submit a request for that feature to be uploaded?

     

    Thanks

  • Profile Image
    EltonCris
    Answered on January 17, 2016 at 04:26 AM

    Sorry for not taking the initiative. I have raised that as a feature request on this thread http://www.jotform.com/answers/746855. Kindly check.

    Thanks!