Advertisement
Guest User

script.js

a guest
Jun 14th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. var userInfo = { };
  2.  
  3. function register() {
  4.  
  5. userInfo = {
  6. email: $("#email").val(),
  7. username: $("#username").val(),
  8. password: $("#password").val()
  9. };
  10.  
  11. bootbox.dialog({
  12. title: "Successfully Created Account",
  13. message: 'Email: ' + userInfo.email + '<br> Username: ' + userInfo.username + '<br> Password: ' + userInfo.password,
  14.  
  15. buttons: {
  16. success: {
  17. label: "Let's go!",
  18. className: "btn-success",
  19. callback: function() {
  20. window.location.replace("Login3.html");
  21. }
  22. }
  23. }
  24. });
  25.  
  26. localStorage.userName = userInfo.username;
  27. localStorage.password = userInfo.password;
  28. }
  29.  
  30. function checkForm() {
  31.  
  32. var username = document.getElementById("announcement-location").value;
  33. var password = document.getElementById("announcement-description").value;
  34.  
  35. if ((username == localStorage.userName) && (password == localStorage.password)) {
  36. setInterval(function() { window.location = "home.html";}, 500);
  37. return false;
  38.  
  39. } else {
  40.  
  41. bootbox.alert({
  42. size: 'small',
  43. message: "Incorrect Password!",
  44. callback: function(){ window.location.replace("Login3.html")}
  45. });
  46.  
  47. }
  48. }
  49.  
  50. document.getElementById("insert").innerHTML = localStorage.userName;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement