Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Script::
- <script>
- $(function() {
- $( "#tags" ).autocomplete({
- source: "pAjax/search.php",
- minLength: 1,
- select: function( event, ui ) {
- log( ui.item ?
- "Selected: " + ui.item.value + " aka " + ui.item.id :
- "Nothing selected, input was " + this.value );
- }
- });
- });
- </script>
- //
- //Search.php
- $term = trim(strip_tags($_GET['term']));
- $result= $crud->dkQuery("SELECT username, first_name, last_name FROM tbl_user WHERE username LIKE '%{$term}%' limit 10");
- $row_set = array(); //u have to define the row_set array
- while ($row = mysql_fetch_array($result))
- {
- $row_set[]=htmlentities(stripslashes($row['first_name'])).' '.htmlentities(stripslashes($row['last_name']));
- }
- echo json_encode($row_set);
- //But, ami kivabe aita akta valuer under a dekhabo? ami down arrow click korleo select korbe value, jemon tumi korecila... Code er kothay vul bujtecina... amar outpur dekhay but select korle value dekhay na input a....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement