Jump to content

SimpleAja

Members
  • Posts

    2
  • Joined

  • Last visited

Reputation Activity

  1. Like
    SimpleAja got a reaction from activa in Help About Input Rules for Text and Password Fileds   
    Not working in blesta with the following regex:
    "rule":["matches", "/((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{6,18})/i"], requires at least 1 lower case character, 1 upper case character, 1 number, 1 special character. length between 6 and 18 character.
    But it works when tried through Regex testing https://www.regextester.com/
  2. Like
    SimpleAja reacted to Tyson in Help About Input Rules for Text and Password Fileds   
    In the Universal Module, you can define service options, which are fields that customers can enter when they order a service.
    You mentioned using regular expressions to validate the input, which you can do by defining them in the "Input Rules" section for each of your fields as described in the Universal Module documentation.
    e.g.
    { "hostname":{ "valid":{ "rule":["matches", "/^[a-z0-9]{1,24}$/i"], "message":"Please enter an alphanumeric hostname between 1 and 24 characters in length." } }, "password":{ "valid":{ "rule":["matches", "/^[a-z0-9\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\+\\_\\-\\=]{10,24}$/i"], "message":"Please enter an alphanumeric password between 10 and 24 characters in length. You may also include any of the following characters: !@#$%^&*()+_-=" } } } My example does not enforce a minimum 1 lower case character, 1 upper case character, or 1 digit, but you can update the regular expression to whatever you need.
×
×
  • Create New...