Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es-ES"><html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" type="text/css" href="21-12-16.css">
  6. <script src="//code.jquery.com/jquery-latest.js"></script>
  7.  
  8.  
  9. <script src="20.js"></script>
  10.  
  11.  
  12. <title>Menu</title>
  13.  
  14. </head>
  15. <body>
  16.  
  17. <div id="header">
  18. <ul class="nav">
  19. <li><a href="">Home</a></li>
  20. <li><a href="">LOGIN</a>
  21. <ul>
  22. <li><a href="" id="conect">Conect</a>
  23.  
  24.  
  25. <ul>
  26. <!--<li><a href="">Sub menu</a></li>-->
  27.  
  28. </ul>
  29. </li>
  30. </ul>
  31. </li>
  32.  
  33.  
  34. </ul>
  35. </div>
  36. <div id="response-container"></div>
  37. </body>
  38. </html>
  39.  
  40. $(document).ready(function(){
  41.  
  42.  
  43. function Login() {
  44.  
  45.  
  46. this.loadForm =function (){
  47.  
  48. $("#response-container").load("formLogin.php");
  49.  
  50. $( "#formLogin" ).submit(function( event ) { //THIS CODE NOT WORKS
  51.  
  52. alert( "Handler for .submit() called." );
  53. event.preventDefault();
  54.  
  55. });
  56.  
  57. };
  58.  
  59. this.searchData = function() {
  60.  
  61. getdetails( "1" )
  62.  
  63. .done( function( response ) {
  64.  
  65. if( response.success ) {
  66. alert("Success");
  67.  
  68. } else {
  69.  
  70. }
  71. })
  72.  
  73. .fail(function( jqXHR, textStatus, errorThrown ) {
  74. $("#response-container").html("fail");
  75. });
  76.  
  77.  
  78. };
  79.  
  80.  
  81. var getdetails = function(id){
  82.  
  83. return $.getJSON( "20.php", { "id" : id });
  84. }
  85.  
  86.  
  87.  
  88.  
  89. };
  90.  
  91.  
  92.  
  93. //LISTENERS
  94.  
  95.  
  96. $('#conect').click(function(e){
  97. e.preventDefault();
  98.  
  99. var login= new Login();
  100.  
  101. login.loadForm();
  102.  
  103. });
  104.  
  105.  
  106. });
  107.  
  108. <form id="formLogin" method="get" action="20.html">
  109. USERNAME:<br><input type="text" name="username" /><br>
  110. PASSWORD:<br><input type="password" name="password" /><br>
  111.  
  112. <br><input type="submit" value="Log in" name="login" id="btnInputLogin"/>
  113. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement