+2 votes
10 views

I am trying to implement autocomplete on the attribute named “search”, i imported all ajax classes and tried to put the JS code in it, but its not really working.

Search.php is used to fetch all the values, and all will be put on header.php page…

<?php ob_start(); ?>
<?php include "../db.php"?>
<?php include "../function.php"?>
<?php session_start(); ?>

<!DOCTYPE HTML>
<html>
<head>
    <title>Symphony.com</title>
    <link rel="shotcut icon" type="image/png" href="../favicon/favicon.png">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equivContent-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Mosaic Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
     addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 
    <!-- Bootstrap Core CSS -->

  <link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
    <!-- Custom CSS -->
    <link href="css/style2.css" rel='stylesheet' type='text/css' />
    <!-- Graph CSS -->
    <link href="css/font-awesome.css" rel="stylesheet">
    <!-- jQuery -->
    <!-- lined-icons -->
    <link rel="stylesheet" href="css/icon-font.css" type='text/css' />
    https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
    https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js

        $(function() {

 ("#search").autocomplete({
                source: "search.php",
                minLength: 2,
                select: function (event, ui) {
                    event.preventDefault();
                    $('#search').val(ui.item.id);
                }
            });
 });

    <!-- Meters graphs -->
    http://js/jquery-2.1.4.js


    </head>
<!-- /w3layouts-agile -->
<body class="sticky-header left-side-collapsed"  onload="initMap()">
<section>
    <!-- left side start-->
by (1.1k points)   | 10 views

Please log in or register to answer this question.

Related questions

0 votes
0 answers
+2 votes
0 answers
asked Jun 17, 2020 by abrishnoor (1.7k points) | 16 views
+2 votes
0 answers
+3 votes
0 answers
asked Jun 17, 2020 by noor (1.1k points) | 15 views
+3 votes
1 answer
asked Apr 12, 2020 by athar (3.3k points) | 60 views
0 votes
0 answers
+3 votes
0 answers
+1 vote
1 answer
asked Oct 4, 2020 by toheed (1.4k points) | 46 views
+1 vote
1 answer




Welcome to Meansflow - Where Developers and Students Learn, Share, & Build Careers, where you can ask questions and receive answers from other members of the community.
122 questions
92 answers
43 comments
124 users