0

I want to validate a phone number and make sure the user enters all 10 digits. This can be done using the HTML5 pattern atribute:

<input pattern=".{10,}" title="10 characters minimum">

How can I add this pattern attribute to my input tag in Contact Form 7 ?

This what the mobile number input shortcode looks like:

[text* mobile id:field-mobile]

closed as off-topic by birgire, Pieter Goosen, fuxia Jul 26 '14 at 9:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2

You can use a tel shortcode to do this:

[tel* id:field-mobile 10/10 "placeholder text"]

This brings up the issue of browser support; if the browser in use does not support the tel input type, it will fall back to a plain text field.

Source: http://contactform7.com/text-fields/ (halfway down the page)

Not the answer you're looking for? Browse other questions tagged or ask your own question.