Advertisement
gabs_avila

Untitled

Feb 27th, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <style type="text/css">
  6. body{
  7.  
  8. font-family: helvetica, sans-serif;
  9. font-size: 20px;
  10. }
  11.  
  12. input{
  13.  
  14. padding: 5px, 5px, 15px, 5px;
  15. font-size: 30px;
  16. border-radius: 5px;
  17. width: 300px;
  18. border: 1px solid grey;
  19.  
  20. }
  21.  
  22. #wrap{
  23.  
  24. width: 600px;
  25. margin: 0 auto;
  26.  
  27. }
  28.  
  29. label{
  30.  
  31. position: relative;
  32. float: left;
  33. width: 200px;
  34. top: 15px;
  35.  
  36. }
  37.  
  38. .ele{
  39.  
  40. margin:10px;
  41. }
  42.  
  43. #log{
  44. width: 100px;
  45. margin-left: 150px;
  46.  
  47. }
  48.  
  49. </style>
  50. </head>
  51. <body>
  52. <DIV id="wrap">
  53. <div id="#result"></div>
  54. <DIV class="ele">
  55.  
  56. <label>Email</label>
  57. <input type="text" name="email" id="email" placeholder="eg.youremal.gmail.com">
  58.  
  59. </DIV>
  60.  
  61. <div class="ele">
  62.  
  63. <label>Telephone</label>
  64. <input type="text" name="num" id="num" placeholder="09123456789">
  65.  
  66. </DIV>
  67. <DIV class="ele">
  68.  
  69. <label>Password</label>
  70. <input type="text" name="pass" id="pass" placeholder="Password">
  71.  
  72. </DIV>
  73.  
  74. <div class="ele">
  75.  
  76. <label>Confirm Password</label>
  77. <input type="text" name="2pas" id="2pas" placeholder="Password">
  78.  
  79. </DIV>
  80.  
  81. <div class="ele">
  82.  
  83. <input type="submit" id="log" value="submit">
  84.  
  85. </DIV>
  86.  
  87. </DIV>
  88. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  89. <script>
  90.  
  91. function isEmail(email) {
  92.  
  93. var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  94.  
  95. return regex.test(email);
  96. }
  97. $("#log").click(function() {
  98. var result = "";
  99. var missing ="";
  100.  
  101. if ($("#email").val() == "") {
  102. missing += "<br>email";
  103. }
  104.  
  105. if ($("#num").val() == "") {
  106. missing += "<br>Telephone";
  107. }
  108.  
  109. if ($("#pass").val() == "") {
  110. missing += "<br>Password";
  111. }
  112.  
  113. if ($("#2pas").val() == "") {
  114. missing += "<br>Confirm Password";
  115. }
  116.  
  117. if (missing != "") {
  118. result += "the fallowing fields is missing" + missing ;
  119. }
  120.  
  121. if (isEmail($("#email").val()) == false) {
  122. result += "<p>youremail is not valid</p>";
  123. }
  124.  
  125. if ($.isNumeric($("#num").val()) ==false) {
  126. result += "<p>your nuumber is Numeric</p>"
  127. }
  128.  
  129. if ($("#pass").val() != $("#2pas").val()) {
  130. result += "<p>your Password is now valid</p>"
  131. }
  132. if (result !="") {
  133. $("#result").html(result):
  134. }
  135. });
  136. </script>
  137. </body>
  138. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement