Fast Secure Contact Form
Phone number validation problem (7 posts)

  1. chzsoona
    Posted 3 years ago #

    First of all I really like that plug-in! It's great.
    Secondly, I'm having problem with phone number validation like “US format”. I want the validation with this format like “444-666-7776”. User shouldn’t be able to enter more digits in the phone text field. Like 10 digits for phone number and 2 dashes. I want minimum and maximum 12 digits.
    Right now I am using “Validation regex: /^\d+$/” or “Validation regex: ^[2-9]\d{2}-\d{3}-\d{4}$” for phone validation ( US format “ 444-666-7776” ) but it is not working. Display the error message “Invalid input.”
    Can anyone help me to solve this issue, I will appreciate that.


  2. Mike Challis
    Plugin Author

    Posted 3 years ago #

    The extra field has these settings you can use:
    Validation regex: /\d{3}-\d{3}-\d{4}/
    Regex fail message: Please type your phone number like this xxx-xxx-xxxx

  3. chzsoona
    Posted 3 years ago #

    @Mike Thank you very much, now the required phone validation is working. once again thanks a lot.
    This plugin is awesome.

  4. dotdynamic
    Posted 3 years ago #

    Hi Mike,

    I've tried the above steps to create a phone validation field in the extra field section but no matter what Regex I enter the form returns the error message and does not submit the contact form.

    I am running the site in question locally with MAMP and using PHP 5.3.6. ANy suggestions on how to troubleshoot this?


  5. Mike Challis
    Plugin Author

    Posted 3 years ago #

    Matthew, I cannot really help if your site is not where I can see it.


  6. mrogero
    Posted 3 years ago #

    Hi Mike,

    I'm in Brazil (São Paulo) and use your awesome plugin! Here the people use the telephone numbers like this:

    11 7758-5146 or 11 7758 5146 or 11 7758.5146 - I need to let the people write in the camp symbols like: ) ( - . and the keyspace

    How can i do this?
    Marcos Rogero

  7. Mike Challis
    Plugin Author

    Posted 3 years ago #

    Marcos a quick Google search found this

    good luck

    A simple expression to brazilian phone number code modified expression of Rafael, beyond international code, simple DDI without "+" 99 plus simple DDD (99) plus simple and whitout parentheses em trace, local phone number 3 or 4 digits plus "-" plus 4 digits.
    552123236699 | 212323-6699 | 2323-6699
    [3434-3432] | [4(23)232-3232] | [55(2)232-232]

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Fast Secure Contact Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic