Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" href="style.css" type="text/css"></link>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script>
- $(function() {
- // load up the results initially with AJAX call
- // see http://api.jquery.com/load/
- $('#ajax_results').load('PencarumMengikutTahun.php');
- //make AJAX GET calls as user types..
- $('#fname').keydown( function(){
- //send the value to the php script in the querystring
- var nme = $(this).val().trim();
- $('#ajax_results').load('PencarumMengikutTahun.php?fname='+nme);
- });
- $('#AjaxPencarumMengikutTahun').submit( function(){
- //send the form values via POST with javascript object
- var data =
- {
- tarikhdaftar: $('#tarikhdaftar').val(),
- icPencarum: $('#icPencarum').val()
- };
- $('#ajax_results').load('PencarumMengikutTahun.php', data);
- //prevent the normal submit action since we're using AJAX
- return false;
- });
- });
- </script>
- </head>
- <body>
- <form action="PencarumMengikutTahun.php" method="get">
- <label for="fname">Tahun</label> <input type="text" name="fname" id="fname" />
- </form>
- <div id="error"></div>
- <div id="ajax_results"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement