• Hi,
    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.
    Thanks

    http://wordpress.org/extend/plugins/si-contact-form/

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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

    Thread Starter chzsoona

    (@chzsoona)

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

    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?

    Cheers,
    Matthew

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

    Mike

    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?
    Thanks!
    Marcos Rogero

    Marcos a quick Google search found this
    /^([0-9]{2})?((\([0-9]{2})\)|[0-9]{2})?([0-9]{3}|[0-9]{4})(\-)?[0-9]{4}$/

    good luck

    Expression
    ^([0-9]{2})?((\([0-9]{2})\)|[0-9]{2})?([0-9]{3}|[0-9]{4})(\-)?[0-9]{4}$
    Description
    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.
    Matches
    552123236699 | 212323-6699 | 2323-6699
    Non-Matches
    [3434-3432] | [4(23)232-3232] | [55(2)232-232]

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Fast Secure Contact Form] Phone number validation problem’ is closed to new replies.