What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to preset Country Code & Area Code in Phone Number field?Asked by AIFIB on August 06, 2013 at 01:28 PM
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
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.
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?
P.S. To this form I still have questions specifically on address fields/arrangement of the address fields. I will post this under a new title!
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="https://shots.jotform.com/welvin/pages/uneditable-phone-country-area-codes.html" 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.
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?
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.
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.