Project introdu...LOGIN

Project introduction of JS development verification form tutorial

This course uses the development of "Javascript Development Verification Form" as a course project example to explain the ideas of developing "Javascript Development Verification Form".

Preparation:

Create a new form.html page, then layout it and write js code

Let's take a look at the flow chart for developing a verification form:

流程图.png

Let’s explain the flow chart

1. First we need to judge whether the user name is empty. If it is not empty, we will then judge whether it meets the specifications. If does not meet the requirements, a prompt message will be given. If it meets the specifications, we will continue to verify

2. Verify whether the password is empty. If it is empty, a prompt message will be given. If it is not empty, determine whether it meets the specifications.

3 Then determine the mailbox. If it is empty, a prompt message will be given. If it is not empty, use regular expression matching to see whether it conforms to the mailbox format.

4 When judging whether the hobby is empty, a prompt message will be given if it is empty. If it is not empty, check whether it meets the specifications.


Next Section
<!DOCTYPE html> <html> <head>     <meta charset="utf-8">     <title></title> </head> <body>     <div id="div">         <form>             <label>用户名:</label>             <input type="text" class="name" id="name">             <div id="sp" class="div"></div>                             <label>密 码:</label>             <input type="password" class="pwd" id="pwd">             <div id="sp1" class="div"></div>             <label>邮 箱:</label>             <input type="text" class="email" id="email">             <div id="sp2" class="div"></div>             <label>爱 好:</label>             <textarea rows="5" cols="30" class="txt" id="txt"></textarea>             <div id="sp3" class="div"></div>             <input type="button" class="sub" value="注册" id="sub">         </form>     </div> </body> </html>
submitReset Code
ChapterCourseware