Register step by step.

Source: Internet
Author: User

Register step by step. Enter the required information for the next demonstration.

 

XML/HTML Code
  1. <Div id = "form">
  2. <Form method = "post">
  3. <Ul>
  4. <Li class = "email">
  5. <Label> Email: </label> <br/>
  6. <Input type = "text" name = "email" id = "email"/>
  7. <Span class = "error"> </span>
  8. </Li>
  9. <Li class = "username">
  10. <Label> Username: </label> <br/>
  11. <Input type = "text" name = "name" id = "username"/>
  12. <Span class = "error"> </span>
  13. </Li>
  14. <Li class = "password">
  15. <Label> Password: </label> <br/>
  16. <Input type = "password" name = "password" id = "password"/>
  17. <Span class = "error"> </span>
  18. </Li>
  19. <Li class = "submit">
  20. <Input type = "submit" value = "Register" id = 'submit '/>
  21. </Li>
  22. </Ul>
  23. </Form>
  24. </Div>

 

JavaScript Code
  1. <Script type = "text/javascript">
  2. $ (Function ()
  3. {
  4. $ ("Ul li: first"). show ();
  5. Var ck_username =/^ [A-Za-z0-9 _] {} $ /;
  6. Var ck_email =/^ [a-zA-Z0-9. _-] + @ [a-zA-Z0-9-] + \. [a-zA-Z.] {} $ /;
  7. $ ('# Email'). change (function ()
  8. {
  9. Var email = $ (this). val ();
  10. If (! Ck_email.test (email ))
  11. {
  12. Certificate (this).next().show().html ("Enter valid email ");
  13. }
  14. Else
  15. {
  16. $ (This). next (). hide ();
  17. $ ("Li"). next ("li. username"). slideDown ({duration: 'low', easing: 'easeoutelastic '});
  18. }
  19. });
  20. $ ('# Username'). keyup (function ()
  21. {
  22. Var username = $ (this). val ();
  23. If (! Ck_username.test (username ))
  24. {
  25. Certificate (this).next().show().html ("Min 3 charts no Space ");
  26. }
  27. Else
  28. {
  29. $ (This). next (). hide ();
  30. $ ("Li"). next ("li. password"). slideDown ({duration: 'low', easing: 'easeoutelastic '});
  31. }
  32. });
  33. $ ('# Password'). keyup (function ()
  34. {
  35. Var password = $ (this). val ();
  36. If (! Ck_password.test (password ))
  37. {
  38. Certificate (this).next().show().html ("Min 6 Charts ");
  39. }
  40. Else
  41. {
  42. $ (This). next (). hide ();
  43. $ ("Li"). next ("li. submit"). slideDown ({duration: 'low', easing: 'easeoutelastic '});
  44. }
  45. });
  46. $ ('# Submit'). click (function ()
  47. {
  48. Var email = $ ("# email"). val ();
  49. Var username = $ ("# username"). val ();
  50. Var password = $ ("# password"). val ();
  51. If (ck_email.test (email) & ck_username.test (username) & ck_password.test (password ))
  52. {
  53. $ ("# Form" pai.show().html ("
  54. }
  55. Else
  56. {
  57. }
  58. Return false;
  59. });
  60. })
  61. </Script>

 


Address: http://www.freejs.net/article_biaodan_139.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.