Home > front end >  Solution, using HTML and js
Solution, using HTML and js

Time:10-09

User registration form for form validation: (1) name: 5-15, or are Chinese characters, or are in English letters (can have a space),
2 phone Numbers: 11 of the mobile phone or fixed phone number (with area code, both formats, such as: 010-32012345, (0317)35512345 67),
(3) the password: 6-18, at least one lowercase letter, at least one capital letter and at least one number, at least one non-alphanumeric, two passwords must be the same,
(4) the name, telephone number, email address and password are mandatory,

CodePudding user response:

Use regular expressions to do ah, very simple

CodePudding user response:

Where it yourself first, will no longer ask,
The most hate myself for doing nothing, the whole project requirements coming directly to the results,

CodePudding user response:

Has a corresponding regular online, under the baidu

CodePudding user response:

refer to the second floor sky waves reply:
yourself first, where will no longer ask,
Hate myself to do nothing, the whole project requirements coming directly to the results,

Let you see??????

CodePudding user response:

Best wishes brother attitude, attitude,,

Bosses at this time, I said wanted to help you

CodePudding user response:

<body>
Input contact regular determine mailbox + cell phone number + machine


<script type="text/javascript">
//regular contact/email + phone number + machine/
The function fn (e) {
//regular//- ^ - starting with what -- -- -- -- --
//- $- to what end -
//- {n} - testing and have n front of -- -- -- -- --
Var preg=new RegExp (
"(^ ([a - z0-9 a - Z] + [_ - - | | \ \]?) + [a - z0-9 a - Z] @ ([a - z0-9 a - Z] + (-/a - z0-9 a - Z +)? \ \.) + [a zA - Z] {2} $) | (^ 13 [0-9] {9} $14 [0-9] {9} | | 15 [0-9] {9} $18 [0-9] {9} | $) | (^ 0 (10 (0-5789) | | 2 \ \ d {3}) \ \ d {7, 8} $) "
);
//- e.v alue, content of the input values (parameters) -- -- -- -- -- --
//object - preg - -- -- -- -- --
//-- the test method () -- -- --
if (! The (preg e.v alue)) {
Alert (" please enter the correct contact way ');
return false;
} else {
Alert (' input right ');
return false;
}
}
</script>

CodePudding user response:

Limit how much input words and required are simple baidu it can solve the regular with what method to trigger the requirements

CodePudding user response:

Give you write a regular expression, the other is simple, oneself do,

(1) name: 5-15 or are Chinese characters, or are in English letters (can have a space),
If (/^ ([\ u4e00 - \ u9fa5] {3, 7} | [A Za - z \ s] {2} 5) $/. The test (STR))

2 phone Numbers: 11 of the mobile phone or fixed phone number (with area code, both formats, such as: 010-32012345, (0317)35512345 67),
If (/^ (\ d {11} | (\ d {3, 4} - | \ (\ d {3, 4} \)) \ d {8, 10}) $/. The test (STR))

(3) the password: 6-18, at least one lowercase letter, at least one capital letter and at least one number, at least one non-alphanumeric,
If (/^ (?=. * ([a-z])?=. * ([a-z])? (=. * \ d)?=. * [^ A Za - z \ d]) {6} 16 $/. The test (STR))

CodePudding user response:

refer to the second floor sky waves reply:
yourself first, where will no longer ask,
Hate myself to do nothing, the whole project requirements coming directly to the results,

Sorry, talk with, I'm not don't want to do, is not a clue so to ask