Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. <li class="loginlink">
  2. <a id="showlogin" href="#">
  3. <span style="color: #666666">Login</span>
  4. </a>
  5. <div class="loginbox" style="display: block;">
  6. <fieldset>
  7. <label>User Name : </label>
  8. <input id="input" type="text" value="" name="input">
  9. </fieldset>
  10. <label>
  11. <span style="display: inline-block; ...;"> Password :</span>
  12. </label>
  13. <input id="password_txt" type="password" style="padding:5px;..;"
  14. value="" name="password_txt">
  15. <p>
  16. <a class="loginlink" onclick="mojarra.jsfcljs(document.getElementById('headerForm'),
  17. {'j_idt60':'j_idt60'},'');return false" style="color: #666666;.."
  18. href="#">Forgot Password?
  19. </a>
  20.  
  21. <a class="loginlink" onclick="mojarra.jsfcljs(document.getElementById('headerForm'),
  22. {'j_idt63':'j_idt63'},'');return false" style="..."
  23. href="#">Register
  24. </a>
  25. </p>
  26. <div class="loginbuttons">
  27. <input id="loginBtn" type="submit" value="Login" name="loginBtn">
  28. <input id="cancellogin" type="button" value="Cancel">
  29. </div>
  30. </div>
  31. </li>
  32.  
  33. $('#showlogin').click(function(){
  34. var loginBox = $('.loginbox');
  35. loginBox.show();
  36. $('.loginbox fieldset input').focus();
  37. if (!loginBox.is(':hidden')) {
  38. validateUser();
  39. }
  40. });
  41.  
  42. $('#cancellogin').click(function(){
  43. $('.loginbox').hide();
  44. });
  45.  
  46. function validateUser() {
  47. $("#loginBtn").click(function(event){
  48.  
  49. var userName = $("#input").val();
  50. var password = $("#password_txt").val();
  51.  
  52. if (userName == "") {
  53. $.dialog({
  54. message: "UserName must be entered",
  55. imageIcon: false,
  56. type: "error",
  57. okButtonID: "ok",
  58. okButtonValue: "OK"
  59. });
  60. return false;
  61. }
  62. return true;
  63. }); //end of click
  64. } //end of validateUser()
  65.  
  66. function validateUser() {
  67. $("#loginBtn").click(function(event){
  68. ...
  69. });
  70. }
  71.  
  72. $(document).ready(function () {
  73.  
  74. $("#loginBtn").click(function (event) {
  75.  
  76. var userName = $("#input").val();
  77. var password = $("#password_txt").val();
  78.  
  79. if (userName == "") {
  80. $.dialog({
  81. message: "UserName must be entered",
  82. imageIcon: false,
  83. type: "error",
  84. okButtonID: "ok",
  85. okButtonValue: "OK"
  86. });
  87. return false;
  88. }
  89. return true;
  90. });
  91.  
  92. $('#showlogin').click(function () {
  93. var loginBox = $('.loginbox');
  94. loginBox.show();
  95. $('.loginbox fieldset input').focus();
  96. // code to call validate user removed from here!
  97. });
  98.  
  99. $('#cancellogin').click(function () {
  100. $('.loginbox').hide();
  101. });
  102. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement