SangeethaVarun Posted November 26, 2012 Share Posted November 26, 2012 Hi I am working with search form in php. I want my search button to work with autocomplete for three search bars. Kindly guide me with the coding for the search button to get connected with the result displaying. Please find attached my header file. The autocomplete is working, fetching the values from the database but I want - when we click on search button it should display the result. Thanks in advance. Expecting the reply from you soon.header.php Quote Link to comment https://forums.phpfreaks.com/topic/271217-search-form/ Share on other sites More sharing options...
SangeethaVarun Posted November 26, 2012 Author Share Posted November 26, 2012 (edited) Hi I am working with search form in php. I want my search button to work with autocomplete for three search bars. Kindly guide me with the coding for the search button to get connected with the result displaying. Please find attached my header file. The autocomplete is working, fetching the values from the database but I want - when we click on search button it should display the result. Thanks in advance. Expecting the reply from you soon. Edited November 27, 2012 by SangeethaVarun Quote Link to comment https://forums.phpfreaks.com/topic/271217-search-form/#findComment-1395368 Share on other sites More sharing options...
AyKay47 Posted November 27, 2012 Share Posted November 27, 2012 Holy global batman! Please post the relative code in this thread instead of an attachment. Quote Link to comment https://forums.phpfreaks.com/topic/271217-search-form/#findComment-1395369 Share on other sites More sharing options...
SangeethaVarun Posted November 27, 2012 Author Share Posted November 27, 2012 <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.2.js"></script> <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script> $(function() { $( "#s" ).autocomplete({ source: "http://search_category.php", minLength: 1, select: function( event, ui ) { $('#s').val(ui.item.s); }, }); $( "#catsearch" ).autocomplete({ source: "http://search_location.php", minLength: 1, select: function( event, ui ) { $('#catsearch').val(ui.item.catsearch); }, }); $( "#company" ).autocomplete({ source: "http://search_company.php", minLength: 1, select: function( event, ui ) { $('#company').val(ui.item.company); }, }); }); </script> $string .= "<form method='get' action='".$GLOBALS['bloginfo_url']."/' name='searchBox' id='searchBox'> <input placeholder='e.g. Plumbers' id='category' /> <input id='location' placeholder='e.g. Town/City' /> " ; $string .= '<input placeholder="e.g. Pizza Hut" class="cocolor" id="company" name="cat">'; /*id=catsearch*/ } } $string .= '<div class="searchBtn left" onclick="document.searchBox.submit();"> </div>'; } $string .= '</form>'; Quote Link to comment https://forums.phpfreaks.com/topic/271217-search-form/#findComment-1395371 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.