How to preset Country Code & Area Code in Phone Number field?

  • Profile Image
    Asked on August 06, 2013 at 01:28 PM

    Hi there,

    The telephone country code (ex. +49) and the local area code  (ex. 6228) should be like "forced" in the numerical length specified.

    telephone country code
    local area code
    phone number
    3-digit fixed-preset, numerically

    (ex. +49, for Germany)
    4-digit fixed-preset, numerically

    (ex. 6228)
    input-flexible, numerically

    (no specifications)
  • Profile Image
    Answered on August 06, 2013 at 03:27 PM


    Unfortunately, we don't have a function to preset or input an uneditable default value for Phone Number field (without masking). You have to use the form source codes, add additional scripts to do this.

    Example Modified Form Embedded to an HTML Page:

    Do you want to embed the form source codes with added scripts? Let us know if you want this so we can further assist. Please finish your form if you want this method.


  • Profile Image
    Answered on August 07, 2013 at 01:08 PM

    Hi Welvin,

    maybe I did not put the question quite understandable! Your proposal (uneditable-phone-country-area-codes) is basically all right, until only the field are code. This field should not  contain a predefined area code, but the person who fills out the form, should can not enter more than four digits, for the area code as an International version. So I meant it. I want to embed the form via an iFrame in a website builder that would go well with no additional scripts?


    Many thanks!

    To this form I still have questions specifically on address fields/
    arrangement of the address fields. I will post this under a new title!

  • Profile Image
    Answered on August 07, 2013 at 02:32 PM


    Thanks for the additional information. Understood now! Unfortunately, there's no way in our form builder we can limit the entry for the said field without the workaround using the form source codes and adding custom scripts.

    If you want to embed the form in iFrame, that is possible with the following smart tips:

    1. We modify the form source codes to include the non-editable Country Code and limited entry for Area Code.

    2. We save the modified source codes as HTML.

    3. Upload the HTML file to your server.

    4. Get the full file path and embed it as an iFrame per example codes below:

    <iframe id="JotFormIFrame" allowtransparency="true" src="" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

    The URL in RED should be replaced by your own HTML file. 

    Please check again the example modified form in my file. You can see the change for the Area Code.


  • Profile Image
    Answered on August 12, 2013 at 02:08 PM

    Hi, Welvin,

    the change
    is great! Another question in the finished HTML code is then CSS code included? I can not intervene in the Head section of the website builder, so my question.
    The HTML page that contains the code can I take without any problems on my webspace and then refer to your example, of course I will use the path of the uploaded website to my webspace. My question is this approach best?

  • Profile Image
    Answered on August 12, 2013 at 05:54 PM


    It does not have a CSS added. I have just added a few HTML Line that would accomplish the limit and to disable the Country Code as opposed the custom script (javascript) added to the form source codes. But still, you have to embed the modified source codes per instructions on my previous response.

    Yes, that is the best way and our recommended way to make this possible. We don't have the function so we provide you the workaround. This should work like the normal form.

    Again, I can help you about this - if you need. Just please finish your form and let us know the form URL so we can check, get the source codes and modify it.


  • Profile Image
    Answered on August 14, 2013 at 09:52 AM

    Hi Welvin, thank you!

    the form is not yet ready. 
    I will embed the form in a password (.htaccess) protected area. When it's time to get you back again on your offered help.