Mautic Community Forums

Validating phone and mobile field in Mautic form

I am wondering if there is a way for us to improve Mautic in terms of validation method on some fields, such as phone number and mobile number.

We’d like to validate the data input on the phone number and mobile number with the following constraints / conditions before the form is able to submit the data once the Submit button is clicked.

  • Phone Number: must not be empty or filled with space key, must be Australian and New Zealand number format compliant, i.e. 10 digit for landlines -2 for the area code and 8 for the number.

  • Mobile Number: must not be empty or filled with space key, must be Australian and New Zealand number format compliant, i.e. 10 digits. Has prefix either 04 or 614 (Aus) / 64 (New Zealand)

Any suggestions or advice would be greatly appreciated with thanks.