Guest User

Untitled

a guest
Jan 17th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <!-- Required meta tags -->
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7.  
  8. <!-- Bootstrap CSS v4.0.0 (alpha 3) -->
  9. <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css">
  10.  
  11. <!-- FormValidation CSS file -->
  12. <link rel="stylesheet" href="/vendor/formvalidation/dist/css/formValidation.min.css">
  13.  
  14. <!-- jQuery v1.9.1 or higher -->
  15. <script src="/vendor/jquery/jquery.min.js"></script>
  16.  
  17. <!-- Tether library, which is required if you want to use Bootstrap tooltip -->
  18. <script src="/vendor/tether/dist/js/tether.min.js"></script>
  19.  
  20. <!-- Bootstrap JS -->
  21. <script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
  22.  
  23. <!-- FormValidation plugin and the class supports validating Bootstrap form -->
  24. <script src="/vendor/formvalidation/dist/js/formValidation.min.js"></script>
  25. <script src="/vendor/formvalidation/dist/js/framework/bootstrap4.min.js"></script> </head>
  26. <body>
  27.  
  28.  
  29. <form id="signinForm">
  30. <div class="form-group">
  31. <input type="text" class="form-control" name="username" placeholder="Username" />
  32. </div>
  33.  
  34. <div class="form-group">
  35. <input type="password" class="form-control" name="password" placeholder="Password" />
  36. </div>
  37.  
  38. <!-- Do NOT use name="submit" or id="submit" for the Submit button -->
  39. <button type="submit" class="btn btn-primary">Sign in</button>
  40. </form>
  41.  
  42. <script>
  43. $(document).ready(function() {
  44. $('#signinForm').formValidation({
  45. framework: 'bootstrap4',
  46. icon: {
  47. valid: 'fa fa-check',
  48. invalid: 'fa fa-times',
  49. validating: 'fa fa-refresh'
  50. },
  51. fields: {
  52. username: {
  53. validators: {
  54. notEmpty: {
  55. message: 'The username is required'
  56. },
  57. stringLength: {
  58. min: 6,
  59. max: 30,
  60. message: 'The username must be more than 6 and less than 30 characters long'
  61. },
  62. regexp: {
  63. regexp: /^[a-zA-Z0-9_]+$/,
  64. message: 'The username can only consist of alphabetical, number and underscore'
  65. }
  66.  
  67. }
  68. }
  69. ,
  70. password: {
  71. validators: {
  72. notEmpty: {
  73. message: 'The password is required'
  74. }
  75. }
  76. }
  77. }
  78. });
  79. });
  80. </script>
  81.  
  82.  
  83. </body>
  84. </html>
Add Comment
Please, Sign In to add comment