Home > Back-end >  The JSP page, how to achieve registration tips?
The JSP page, how to achieve registration tips?

Time:12-28

Such as: if the user name is not in conformity with the requirements in the input box on the right side of the prompt "username does not conform to the requirements!"
Requirements: no javascript

Tip:
1. Use the Layui template
2. User name a regular expression is "[\ \ u4E00 - \ \ u9FA5a - zA - Z0-9 - _ \ \ \ \ d u00B7] {4, 20}"
The code below
Register. The JSP:
 & lt; % @ page language="Java" contentType="text/HTML. Charset=utf-8 "pageEncoding=" utf-8 "% & gt; 
<% @ page import="Java. Util. *" % & gt;
<% @ page import="Java. Util. Regex. *" % & gt;


<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
Site warehouse - user registration & lt;/title> <br/><link rel="stylesheet" href="https://bbs.csdn.net/topics/css/layui.css" & gt; <br/><link rel="stylesheet" href="https://bbs.csdn.net/topics/css/global.css" & gt; <br/></head> <br/><br/><body> <br/><Div & gt; <br/><Div & gt; <br/><Ul & gt; <br/><Li style="font - size: 25 px" & gt; Site warehouse & lt;/li> <br/></ul> <br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; <br/><Div & gt; <br/><The form action="" target=" iframe "& gt; <br/><Div & gt; <br/><The label style="font, size: 20 px" & gt; User registration & lt;/label> <br/></div> <br/><Div & gt; <br/><The label & gt; The user name & lt;/label> <br/><Div style="width: 250 px" & gt; <br/><Input type="text" name="username" required "verify=" required "autocomplete=" off "& gt; <br/></div> <br/><! - the username error - & gt; <br/><Div & gt; <br/><! -, if the user name is not in conformity with the requirements, the prompt "username does not conform to the requirements!" - & gt; <br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; <br/><Div & gt; <br/>User name length is 4-20, by the Numbers, letters, Chinese characters, a minus sign (-), underscores (_) and separation dot (,) <br/></div> <br/></div> <br/></div> <br/><Div & gt; <br/><The label & gt; Email & lt;/label> <br/><Div style="width: 250 px" & gt; <br/><Input type="text" name="title" required "verify=" required "autocomplete=" off "& gt; <br/></div> <br/><! - email error message - & gt; <br/><Div & gt; <br/><br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; </div> <br/></div> <br/><Div & gt; <br/><The label & gt; Password & lt;/label> <br/><Div style="width: 250 px" & gt; <br/><Input type="password" name="password" required "verify=" required "autocomplete=" off "& gt; <br/></div> <br/><! - the password error message - & gt; <br/><Div & gt; <br/><br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; <br/><Div & gt; <br/>Password length is 8 to 20, and contains at least one letter <br/></div> <br/></div> <br/></div> <br/><Div & gt; <br/><The label & gt; Confirm password & lt;/label> <br/><Div style="width: 250 px" & gt; <br/><Input type="password" name="password" required "verify=" required "autocomplete=" off "& gt; <br/></div> <br/><! - confirm password error message - & gt; <br/><Div & gt; <br/><br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; </div> <br/></div> <br/><Div & gt; <br/><Div & gt; <br/><The button type="submit" & gt; Registration & lt;/button> <br/><The button type="reset" & gt; Reset & lt;/button> <br/></div> <br/></div> <br/><Div & gt; <br/><Div & gt; <br/><A href="https://bbs.csdn.net/topics/welcome.jsp" & gt; Existing users? Login & lt;/a> <br/></div> <br/></div> <br/></form> <br/><br/><The iframe id="iframe" name="iframe" style="display: none;"> </iframe> <br/><br/></div> <br/></div> <br/></div> <br/></body> <br/></html> </pre> <br/> </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/Backend/96433.html" target="_blank" style="color:#999">https//www.codepudding.com/Backend/96433.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/Backend/96432.html'>Delphi handle problems after the Dock</a></div> <div class="detail-arr-right">Next:<a href='/Backend/96434.html'>FutureTask asynchronous problem, a week, the white may not be the solution</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=Web+development' target='_blank'>Web development</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>