Mobile custom field validation


I'm using Sign up forms to create a "Copy/paste a form to your site" signup form.

I have a custom mobile number field that I would like to validate as a number.

I can get it to validate if there is no data entered in the field.

<label for="fieldiilthty">mobile</label><br />
<input id="fieldiilthty" name="cm-f-iililkj" type="text" required />

Is there a way to check if the data entered is a number?



balthazar balthazar, 1 year ago

Hello Wayne! First, I'd recommend taking a look at this article we have about adding validation to a form. The example we give is for validating the email address, but you can find JavaScript to validate phone numbers. I hope that gets you pointed in the right direction!

DesWork, 1 year ago

Thanks balthazar,

Managed to get it validating using the article example.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free