javascript - Jquery Autocomplete results link not working on click -
i using jquery autocomplete.i getting search results database. when start typing in search box getting suggestions.i have given link results using <a href="results.html>
. when click on suggestions not getting results.html
i need redirect results.html page onclick on suggestions how can that?
code:jquery
$().ready(function() { $("#search").autocomplete("php/getvalues.php", { width: 383, matchcontains: true, //mustmatch: false, //minchars: 0, //multiple: true, //highlight: true, //multipleseparator: ",", selectfirst: false });
});
getvalue.php
<?php require_once "config.php"; $q = strtolower($_get["q"]); if (!$q) return; $sql = "select file_name,img_url,captions completer"; $rsd = mysql_query($sql); while($rs = mysql_fetch_array($rsd)) { $fname = $rs['file_name']; $iurl = $rs ['img_url']; $caption = $rs ['captions']; echo '<a href="results.html" class="searchres" style="color:#696969;text-decoration:none;"><img src='.$iurl.' class="icons" /><div class="results" style="color:#696969;text-decoration:none;">'."$fname".'</div><span style="color:#696969;text-decoration:none;" class="author">'.$caption.'</span></a>'."\n"; } ?>
html:
<form method="post" name="myform" class="ourform"> <input type="search" id="search" name="search" placeholder="type or speak here search"> <input type="image" alt="submit" src="images/search.jpg" class="submit"/> </form>
you need put action in form element so:
<form method="post" name="myform" class="ourform" action="/results.html">
Comments
Post a Comment