Guest User

Untitled

a guest
Oct 30th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. $(document).ready(function(){
  2.  
  3.  
  4. $("button").on("click", function(){
  5. username = $("#username").val();
  6. password = $("#password").val();
  7.  
  8. //here shoule have come the code to recieve the data from python to stop sending the post request
  9. //
  10.  
  11.  
  12. return filled(username, password);
  13. });
  14.  
  15. $.getJSON("/login", function(data){
  16. cosole.log("mm");
  17. });
  18.  
  19.  
  20. });
  21.  
  22. function filled(username, password)
  23. {
  24. if(!username && ! password){
  25. $("#invalid1").show();
  26. $("#invalid2").show();
  27. return false;
  28. }
  29. else if(!password)
  30. {
  31. $("#invalid2").show();
  32. $("#invalid1").hide();
  33. return false;
  34. }
  35. else if (!username){
  36. $("#invalid1").show();
  37. $("#invalid2").hide();
  38. return false;
  39. }
  40. else
  41. {
  42. $("#invalid1").hide();
  43. $("#invalid2").hide();
  44. }
  45. }
Add Comment
Please, Sign In to add comment