Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title></title>
  5. <script type="text/javascript" src="js/alertify.js"></script>
  6. <link rel="stylesheet" type="text/css" href="css/alertify.css">
  7. </head>
  8. <body>
  9. <form id="form">
  10.  
  11. <h3>Account</h3>
  12. <br />
  13. <label for="userName">User name *</label>
  14. <br />
  15. <input id="userName" name="userName" type="text" class="required">
  16. <br />
  17. <label for="password">Password *</label>
  18. <br />
  19. <input id="password" name="password" type="text" class="required">
  20. <br />
  21. <label for="confirm">Confirm Password *</label>
  22. <br />
  23. <input id="confirm" name="confirm" type="text" class="required">
  24. <p>(*) Mandatory</p>
  25. <input type="button" id="submit" onclick="checkFields()" value="OK">
  26. </form>
  27.  
  28. </body>
  29. </html>
  30. <script type="text/javascript">
  31.  
  32. function checkFields() {
  33. var user = document.forms["form"]["userName"].value;
  34. var password = document.forms["form"]["password"].value;
  35. var confirm= document.forms["form"]["confirm"].value;
  36.  
  37. if (user == "" || password == "" || confirm == "") {
  38. alert("Name must be filled out");
  39. return false;
  40. }
  41.  
  42. if (password != confirm) {
  43. alertify.alert('Viga','Paroolid ei ühti!');
  44. }
  45.  
  46. var matches = password.match(/\d+/g);
  47. if (matches == null) {
  48. alert('Parool peab sisestama vähemalt ühte numbrit');
  49. }
  50.  
  51. }
  52.  
  53.  
  54. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement