Jump to content
  • 0

Help About Input Rules for Text and Password Fileds


Question

Posted

https://docs.blesta.com/display/user/Universal+Module

Using the Universal Module For Shared Hosting

Need Domain /^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/i
username 6-8 Digit lowercase with number
password

 

How to Ask 
 

{
    "Domain":{
        "valid":{
            "rule":["matches", "/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/i"],
            "negate":true,
            "message":"Domain must not be empty."
        }
    },
    "username":{
        "valid":{
            "rule":["matches", "/^[a-z0-9\\$\\%\\^]{6,8}$/i"],
            "message":"Please enter a username using alphanumeric characters between 6 and 8 characters in length. You may also include number characters like 123."
        }
    }"password":{
        "valid":{
            "rule":["matches", "/^[a-z0-9\\$\\%\\^]{8,20}$/i"],
            "message":"Please enter a password using alphanumeric characters between 8 and 20 characters in length. You may also include special characters like '$%^'."
        }
    }
}

 

Screenshot from 2020-02-18 03-16-50.png

4 answers to this question

Recommended Posts

  • 0
Posted

You are saying these do not work? What use cases are not failing/succeeding as expected?

A couple notes on the username regex.  The i modifier at the end makes it case insensitive so it can be upper or lower case.  Also you allow for the $%^ characters in the username, is that intentional?

Also I notice that you use the negate option for the domain rule. So you are validating that the submitted domain does NOT match that regex.

Finally, you are missing a comma after the curly brace just before the start of the "password" rule.

  • 0
Posted

Also, you're missing a comma before your password rule. Try this ruleset:

 

{
    "Domain":{
        "valid":{
            "rule":["matches", "/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/i"],
            "message":"Domain must not be empty."
        }
    },
    "username":{
        "valid":{
            "rule":["matches", "/^[a-z0-9\\$\\%\\^]{6,8}$/i"],
            "message":"Please enter a username using alphanumeric characters between 6 and 8 characters in length. You may also include number characters like 123."
        }
    },
    "password":{
        "valid":{
            "rule":["matches", "/^[a-z0-9\\$\\%\\^]{8,20}$/i"],
            "message":"Please enter a password using alphanumeric characters between 8 and 20 characters in length. You may also include special characters like '$%^'."
        }
    }
}

 

  • 0
Posted

Thanks for Quick Reply.
I done same imput you can login and check

We need valid user Details 

1. Domain : \b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b
2.Username: 
^[a-z0-9]{6,8}$
3.Password: /^[a-z0-9\\$\\%\\^]{8,20}$


https://www.domaingood.com/account/order/config/index/domain/?group_id=2&pricing_id=13

But When user Wrong value:

Domain: web
username:demo@demo.com
password123456
 

Its taking orders without Valid Regular Expressions:(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...