+2 votes
6 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)   | 6 views

Please log in or register to answer this question.

Related questions

0 votes
0 answers
+2 votes
0 answers
+2 votes
0 answers
+3 votes
0 answers
asked Jun 17 by noor (1.1k points) | 3 views
+3 votes
1 answer
asked Apr 12 by athar (2.5k points) | 31 views
0 votes
0 answers
+3 votes
0 answers
+2 votes
0 answers
asked Jun 20 by athar (2.5k points) | 8 views
+2 votes
0 answers
asked Jun 20 by athar (2.5k points) | 8 views




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.
106 questions
75 answers
36 comments
93 users