Advertisement
noam76

search and autocomplete

Apr 24th, 2020
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <?php
  4. include "config.php";
  5.  
  6. $query = "SELECT * FROM products";
  7. $result = mysqli_query($con,$query);
  8.  
  9. echo "<center>";
  10. echo "<form action='' method='POST' class='form-style-9'>";
  11. echo "<select id='searchdd1'>";
  12. echo "<option> -- בחר מוצר -- </option>";
  13.    while($row = mysqli_fetch_array($result) ){
  14.        echo "<option value value='" . $row['product_number'] . "'>$row[product_name]</option>";
  15.    }
  16. echo "</select>";
  17. echo "</form>";
  18. echo "</center>";
  19. mysqli_close($con);
  20. ?>
  21. <head>
  22. <meta charset="UTF-8">
  23. <meta name="viewport" content="width=device-width, initial-scale=1">
  24. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  25. <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js" type="text/javascript"></script>
  26. <link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" rel="stylesheet"/>
  27. <link rel = "stylesheet" type = "text/css" href = "myStyle.css"/>
  28.  
  29. <script>
  30.   $('#searchdd1').chosen();
  31. </script>
  32. </head>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement