justhrun

buku_form.hateemel

Sep 9th, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.17 KB | None | 0 0
  1. <html><head><title>Test AutoSearch</title>
  2. <script type='text/javascript' src='jquery-1.9.1.min.js'></script>
  3. <script type='text/javascript'>
  4. $(document).ready(function() {
  5.    $('#searchit').keyup(function() {
  6.         var key=$('#searchit').val();
  7.         var dataString = 'searchit='+ key;
  8.         if(!key || key.length<3) {
  9.            document.getElementById("hasil").innerHTML = '';
  10.            return;
  11.        }
  12.            
  13.        $.ajax ({
  14.            type: 'POST',
  15.            url: 'caribuku.php',
  16.            data: dataString,
  17.            cache: false,
  18.            success: function(result) {
  19.                document.getElementById("hasil").innerHTML = result;
  20.            }
  21.        });
  22.    });
  23. });
  24.  
  25. function diReset() {
  26.    document.getElementById("searchit").value = '';
  27.    document.getElementById("hasil").innerHTML = '';
  28. }
  29. </script>
  30. </head>
  31. <body bgcolor=#ededed>
  32. <center>
  33. <font color=red size=4><b>Isi Table Daftar Buku</b></font><br>
  34. <img src=images/daftarbuku.jpg><br>
  35. <input type=text name=searchit id=searchit size=10 maxlength=10>&nbsp;<input type=reset value=reset onClick='diReset();'>
  36. <div id=hasil></div>
  37. </center>
  38. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment