Support » Plugin: WooCommerce » email validation

  • Resolved medenz

    (@medenz)


    I’ve got a piece of code that validates email. I need to disable that validation, so the user can type a cellphone number instead of an email. What I’ve done: Step 1: Remove @ to accept the number. I’ve searched in *.js files and change code from

    i=/^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    to this i=/[0-9]/;

    Step 2: I’ve changed the type to number but it doesn’t work. this is the code:

    <input type=”number” value=”” id=”wcwl_email_1662″ name=”wcwl_email” class=”wcwl_email” placeholder=”Email address”>
    After doing these when I enter a cellphone number instead of an email I receive this error message: “I’m afraid something went wrong with your request. Please try again or contact us for help”

    this is the link that I’m working on: https://atlantic7.ir/nikeorange/

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support AW

    (@slash1andy)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Plugin Support Hannah S.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there! No one has been able to chime in, so I’m going to close off this topic. If you need further support, I second AW’s recommendations above.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.