> For the complete documentation index, see [llms.txt](https://support.emarketeer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.emarketeer.com/docs/docs_se/guider/guides/legacy/form-phone-number-validation-re.md).

# Validering av telefonnummer

{% hint style="warning" %}
Den här artikeln gäller **Formulär (Legacy)**. För den nuvarande formuläreditorn, se [Formulär](/docs/docs_se/guider/guides/forms.md).
{% endhint %}

Den här guiden visar hur du kräver en landskod i fältet för mobilnummer i ett formulär när reCAPTCHA är aktivt.

Du lägger till kod i formulärets HTML och justerar vid behov det reguljära uttryck som validerar strängen. Om du använde validering innan du aktiverade reCAPTCHA, byt till "submit captcha"-versionen av koden i steg 2.

***

### 1. Lägg till det här utdraget högst upp i CSS-textrutan på sidan Colors & Fonts -> HTML

***

\
$J = jQuery.noConflict();

***

\
submitForm = function(){\
var jval = jValidate($('formen'),true);\
if(!jval){\
return false;\
}\
var regEx = /^\\\\+\\\[1-9\\]\\\[0-9\\]{7,14}$/;\
var val = $J('input\\\[type=tel\\]').val();\
\
if (!val || val.match(regEx)) {\
const siteKey = window.\\\_\\\_RECAPTCHA\\\_SITE\\\_KEY\\\_\\\_;\
submitCaptchaOK(siteKey);\
} else {\
alert('Enter the mobile number with country code');\
$J('input\\\[type=tel\\]').focus();\
return false;\
}\
}

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.emarketeer.com/docs/docs_se/guider/guides/legacy/form-phone-number-validation-re.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
