


Detailed explanation of jQuery regular verification registration page
This article mainly introduces the jQuery regular verification registration page function, involving regular verification operation skills for user names, passwords, email addresses, mobile phone numbers, etc. Friends who need it can refer to it. I hope it can help everyone.
The example in this article describes the jQuery regular verification registration page function. Share it with everyone for your reference, the details are as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>正则验证注册页面</title> <style type="text/css"> .red{ color:#cc0000; font-weight:bold; } </style> <script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script language="JavaScript"> function $(elementId){ return document.getElementById(elementId).value; } function pId(elementId){ return document.getElementById(elementId); } // 用户名验证 function checkUser(){ var user = $("user"); var userId = pId("user_prompt"); userId.innerHTML=""; var reg=/^[a-zA-Z][a-zA-Z0-9]{3,15}$/; if(reg.test(user)==false){ userId.innerHTML="用户名不正确"; return false; } return true; } // password check function checkPwd(){ var pwd = $("pwd"); var pwdId = pId("pwd_prompt"); pwdId.innerHTML=""; var reg = /^[a-zA-Z0-9]{4,10}$/; if(reg.test(pwd)==false){ pwdId.innerHTML = "密码不能含有非法字符,长度在4-10之间"; return false; } return true; } function checkRepwd(){ var repwd = $("repwd"); var pwd = $("pwd"); var repwdId = pId("repwd_prompt"); repwdId.innerHTML="" if(pwd!=repwd){ repwdId.innerHTML="两次密码不一致"; return false; } return true; } // 邮箱验证 function checkEmail(){ var email = $("email"); var email_prompt = pId("email_prompt"); email_prompt.innerHTML=""; var reg = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/; if(reg.test(email)==false){ email_prompt.innerHTML="Email格式不对,请输入正确email"; return false; } return true; } // 手机号验证 function checkMobile() { var mobile = $("mobile"); var mobileId = pId("mobile_prompt"); mobileId.innerHTML=""; var reMobile = /^1\d{10}$/; if (reMobile.test(mobile)==false){ mobileId.innerHTML="手机号输入有误"; return false; } return true; } // 生日验证 function checkBirth(){ var birth = $("birth"); var birthId = pId("birth_prompt"); birthId.innerHTML=""; var reg = /^((19\d{2})|(200\d))-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-1])$/; if(reg.test(birth)==false){ birthId.innerHTML="生日格式不对"; return false; } return true; } </script> </head> <body> <table class="main" border="0" callpadding="0" cellspacing="0"> <tr> <td><img src="images/logo.jpg" alt="logo"><img src="images/banner.jpg" alt="banner"></td> </tr> <tr> <td class="hr_1">新用户注册</td> </tr> <tr> <td style="height: 10px;"></td> </tr> <form action="" method="post" name="myform"> <tr> <td><table> <tr> <td class="left">用户名:</td> <td class="center"><input type="text" id="user" class="in" onblur="checkUser()"></td> <td><p id="user_prompt">用户名由英文字母和数字组成-4到16位字符,以字母开头</p></td> </tr> <tr> <td class="left">密码:</td> <td class="center"><input type="password" id="pwd" class="in" onblur="checkPwd()"></td> <td><p id="pwd_prompt">密码由英文字母和数字组成的4-10位字符</p></td> </tr> <tr> <td class="left">确认密码:</td> <td class="center"><input type="password" id="repwd" class="in" onblur="checkRepwd()"></td> <td><p id="repwd_prompt"></p></td> </tr> <tr> <td class="left">电子邮箱:</td> <td class="center"><input type="text" id="email" class="in" onblur="checkEmail()"></td> <td><p id="email_prompt"></p></td> </tr> <tr> <td class="left">手机号码:</td> <td class="center"><input type="text" id="mobile" class="in" onblur="checkMobile()"></td> <td><p id="mobile_prompt"></p></td> </tr> <tr> <td class="left">生日:</td> <td class="center"><input type="text " id="birth" class="in" onblur="checkBirth()"></td> <td><p id="birth_prompt"></p></td> </tr> <tr> <td class="left"> </td> <td class="center"><input name="" type="image" src="images/register.jpg" /></td> <td> </td> </tr> </table> </td> </tr> </form> </table> </body> </html>
Related recommendations:
javascript common functions and regular verification expression codes Summary
php uses regular expressions to verify email addresses
HTML example shows using regular expressions to verify the form
The above is the detailed content of Detailed explanation of jQuery regular verification registration page. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

As a platform integrating social networking and e-commerce, Xiaohongshu has attracted more and more users to join. Some users hope to register multiple accounts to better experience interacting with Xiaohongshu. So, how to register multiple accounts on Xiaohongshu? 1. How to register multiple accounts on Xiaohongshu? 1. Use different mobile phone numbers to register. Currently, Xiaohongshu mainly uses mobile phone numbers to register accounts. Users sometimes try to purchase multiple mobile phone number cards and use them to register multiple Xiaohongshu accounts. However, this approach has some limitations, because purchasing multiple mobile phone number cards is cumbersome and costly. 2. Use email to register. In addition to your mobile phone number, your email can also be used to register a Xiaohongshu account. Users can prepare multiple email addresses and then use these email addresses to register accounts. but

Xiaohongshu, a social platform integrating life, entertainment, shopping and sharing, has become an indispensable part of the daily life of many young people. So, how to register a Xiaohongshu account? 1. How to register a Xiaohongshu account? 1. Open the Xiaohongshu official website or download the Xiaohongshu APP. Click the "Register" button below and you can choose different registration methods. Currently, Xiaohongshu supports registration with mobile phone numbers, email addresses, and third-party accounts (such as WeChat, QQ, Weibo, etc.). 3. Fill in the relevant information. According to the selected registration method, fill in the corresponding mobile phone number, email address or third-party account information. 4. Set a password. Set a strong password to keep your account secure. 5. Complete the verification. Follow the prompts to complete mobile phone verification or email verification. 6. Perfect the individual

As one of the most popular lifestyle sharing platforms in the world, Xiaohongshu has attracted a large number of users. So, how to register a Xiaohongshu account? This article will introduce you to the Xiaohongshu account registration process in detail, and answer the question of how to recover Xiaohongshu account abnormalities. 1. How to register a Xiaohongshu account? 1. Download the Xiaohongshu APP: Search and download the Xiaohongshu APP in the mobile app store, and open it after the installation is complete. 2. Register an account: After opening the Xiaohongshu APP, click the "Me" button in the lower right corner of the homepage, and then select "Register". 3. Fill in the registration information: Fill in the mobile phone number, set password, verification code and other registration information according to the prompts. 4. Complete personal information: After successful registration, follow the prompts to complete personal information, such as name, gender, birthday, etc. 5. Settings

qooapp is a software that can download many games, so how to register an account? Users need to click the "Register" button if they don't have a pass yet, and then choose a registration method. This account registration method introduction is enough to tell you how to operate it. The following is a detailed introduction, so take a look. How to register a qooapp account? Answer: Click to register, and then choose a registration method. Specific methods: 1. After entering the login interface, click below. Don’t have a pass yet? Apply now. 2. Then choose the login method you need. 3. You can use it directly after that. Official website registration: 1. Open the website https://apps.ppaooq.com/ and click on the upper right corner to register. 2. Select registration

WeChat is a popular social software with rich functions and many users. If you want to check how long you have been registered on WeChat, although WeChat itself does not directly provide the function of checking the registration time, we can speculate through some indirect methods. However, these methods are not absolutely accurate as various factors may affect the accuracy of the results. If you have precise requirements for the registration time, it is recommended to contact WeChat customer service for consultation. How to check how long it has been since WeChat registration? The first way to see how long you have been registered on WeChat is by checking your QQ mailbox. If you use QQ to log in to WeChat, after successful registration, your QQ mailbox will receive a welcome email from WeChat. You can search for "WeChat" in your QQ mailbox to see if there is such an email, and then determine the registration time. The second way is by looking at

Bilibili (Bilibili), as a video sharing website very popular among Chinese young people, has attracted a large number of users. Some users hope to have two Bilibili accounts so that they can be managed and used separately. So, how to register two B-site numbers with one mobile phone number? This article will focus on this issue and how to unbind the mobile phone. 1. How to register two B-site numbers with one mobile phone number? 1. Register a new account: First, open the Bilibili App on your mobile phone or log in to the official website, click the "Register" button, and select the registration method. You can use your mobile phone number, email or third-party account (such as WeChat, QQ, etc.) to register. 2. When registering an account, please fill in the necessary information according to the system prompts, including mobile phone number, verification code, and set password. Be sure to use different accounts

With the launch of WeChat video accounts, more and more people have seen new traffic opportunities. Therefore, registering a video account matrix account has become the focus of many creators and merchants. So, how to register a video number matrix account? How to create your own video account? This article will answer these two questions in detail. 1. How to register a video number matrix account? 1. WeChat account: First, you need to have a WeChat account. If not, please register one first. 2. Open a video account: In the WeChat APP, find the "Discover" page and click "Video Account" to enter the video account page. 3. Creator Center: At the bottom of the video account page, click the "Creator Center" button to enter the Creator Center. 4. Register a video account: On the Creator Center page, find the "Register Video Account" option.

NetEase Master APP is a social platform for gamers. Users can get game consultation here. Many users want to know whether NetEase Master can re-register after logging out. NetEase Master can re-register after logging out. Can NetEase Master re-register after logging out? Answer: Yes. 1. NetEase Master can re-register after logging out. 2. But you must register for at least one week before you can choose this number to register. 3. The account cannot be specified, and previous data will be cleared. 4. After the user logs out, all previous information and related balances have been cleared. Related articles: How does NetEase master change the bound mobile phone number?
