Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Formular</title>
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> </script>
  6. </head>
  7. <body>
  8. <h1>Formular</h1>
  9. Nume:<input type="text" id="nume"> <br>
  10. Prenume:<input type="text" id="prenume"> <br>
  11. Username:<input type="text" id="username"> <br>
  12. Password:<input type="password" id="password"> <br>
  13. Confirm Password<input type="password" id="confpassword"> <br>
  14. <button id="btn1">Login</button>
  15. <div class="results"> </div>
  16. <button id="btn2" >Home</button>
  17. <script>
  18. $('#btn2').hide();
  19. $('#btn1').click(function(){
  20. var nm=$('#nume').val();
  21. var pn=$('#prenume').val();
  22. var un=$('#username').val();
  23. var pw=$('#password').val();
  24. var cp=$('#confpassword').val();
  25. if(nm=='' || pn=='' || un=='' || pw=='' || cp=='') {
  26. alert ('Date Invalide');
  27. return;
  28. }
  29. else if (pw!=cp) {
  30. alert ('Parolele nu coincid');
  31. return;
  32. }
  33. else {
  34. $('.results').empty();
  35. $('.results').append('Bine ati venit!');
  36. $('#btn2').show();
  37. }
  38. });
  39. $('#btn2').click(function(){
  40. window.location='file:///C:/Users/.../Desktop/index.html';
  41. });
  42. </script>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement