Guest User

Untitled

a guest
Jan 13th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. Function doesn't want to fire [closed]
  2. $( "#login-form" ).dialog({
  3. autoOpen: false,
  4. height: 300,
  5. width: 350,
  6. resizable: false,
  7. modal: true,
  8. buttons: {
  9. "Вход": function() {
  10. var bValid = true;
  11. allFields.removeClass( "ui-state-error" );
  12.  
  13. bValid = bValid && checkAcc( loginname,loginpassword );
  14.  
  15. if ( bValid ) {
  16. //If its valid ...
  17. $( this ).dialog( "close" );
  18. }
  19. },
  20. Изход: function() {
  21. $( this ).dialog( "close" );
  22. }
  23. },
  24. close: function() {
  25. allFields.val( "" ).removeClass( "ui-state-error" );
  26. }
  27. });
  28.  
  29. function checkAcc( u, p ) {
  30. alert();
  31. var result;
  32. $.ajax({
  33. url: "users.php",
  34. data: "Username=" + u.val() + "&Password=" + p.val(),
  35. type: "GET",
  36. cache: false,
  37. async: false,
  38. success: function(Valid){
  39. if(Valid == "0"){
  40. result = false;
  41. u.addClass( "ui-state-error" );
  42. updateTips("Грешно Потребителско име/Парола!");
  43. }
  44. else{
  45. result = true;
  46. }
  47. }
  48. });
  49.  
  50. return result;
  51. }
  52.  
  53. function checkAcc( u, p, element )
Add Comment
Please, Sign In to add comment