Search
 
SCRIPT & CODE EXAMPLE
 

CSS

form validation with css

// add requited attribute and pattern i html for mail : pattern="[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$" 
for only text pattern="^[a-zA-Z]+$" ,

required //

input[type="email"]:valid,input[name="name"]:valid {
	border: solid 3px green;
}
input[type="email"]:invalid:focus,input[name="name"]:invalid:focus {
	border: solid 3px red;
}
or 
input:required {
  border-color: #800000;
  border-width: 3px;
}

input:required:invalid {
  border-color: #c00000;
}





// regex for password

Minimum eight characters, at least one letter and one number:
"^(?=.*[A-Za-z])(?=.*d)[A-Za-zd]{8,}$"

Minimum eight characters, at least one letter, one number and one special character:
"^(?=.*[A-Za-z])(?=.*d)(?=.*[@$!%*#?&])[A-Za-zd@$!%*#?&]{8,}$"

Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)[a-zA-Zd]{8,}$"

Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,}$"

Minimum eight and maximum 10 characters, at least one uppercase letter, one lowercase letter, one number and one special character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,10}$"
9
regex passwordJavascript By DieOver on May 11 2020 DonateThankComment
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})
Source:www.thepolyglotdeveloper.com
5
///// regex for user name 

# works in most newer browsers
^(?=.{8,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$
 └─────┬────┘└───┬──┘└─────┬─────┘└─────┬─────┘ └───┬───┘
       │         │         │            │           no _ or . at the end
       │         │         │            │
       │         │         │            allowed characters
       │         │         │
       │         │         no __ or _. or ._ or .. inside
       │         │
       │         no _ or . at the beginning
       │
       username is 8-20 characters long

# works in all browsers, but does the same as the above RegEx
^(?=[a-zA-Z0-9._]{8,20}$)(?!.*[_.]{2})[^_.].*[^_.]$
Comment

css validation

<p>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
    <img style="border:0;width:88px;height:31px"
        src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
        alt="Valid CSS!" />
    </a>
</p>
Comment

html css form validation

<input
  required 
  type="text" 
  id="first_name"
  name="first_name">
Comment

PREVIOUS NEXT
Code Example
Css :: webpack css not loading 
Css :: Ul or ol with no indent 
Css :: access lamp folder using terminal mac 
Css :: truncate long line with dots 
Css :: if i forked and cloned a github repo can i change the name 
Css :: html or CSS background-color 
Css :: centering icons in footer 
Css :: flex index css 
Css :: make changes to api fetch onclick in react 
Css :: flex grow css 
Css :: Creating Intrinsic Ratios 
Css :: how to take of underline from link through css 
Css :: uikit theme 
Css :: changing the dots of the ul to ticks 
Css :: css not loading after clearing chaches asp.net 
Css :: css code for flash messages flask 
Css :: shiny server configuration 
Css :: vertical align x horizontal 
Css :: adding whitespace in box 
Css :: The HSL color model css 
Css :: child width big 
Css :: clamp(css) 
Css :: how to override hover css 
Css :: how to use figure in spsific size css 
Css :: uytutyu 
Css :: bootstrap pagination left side 
Css :: after 50% not center 
Css :: resizer in vertical 
Css :: width in css 
Css :: print css media query 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =