• Jon

    (@jonmorrow)


    How do patterns work in field settings? I’ve searched the documentation (and this forum) and can’t find anything.

    I’d like to make sure a new user enters a properly formatted U.S. phone number in my phone field. I tried patters of (999) 999-9999 like in WPForms and \(\d\d\d\) \d\d\d\-\d\d\d\d like in a regex, but neither had the desired effect.

    Anyone know how to make sure a phone number is entered into a field?

    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    “pattern” is an HTML5 input attribute. So there’s nothing magical in WP-Members about the use of patterns – it’s just the standard HTML5 (as if you were creating an input tag directly).

    All you need is a valid HTML5 regex for your pattern. There are various regex libraries on the web.

Viewing 1 replies (of 1 total)

The topic ‘Patterns in fields’ is closed to new replies.