How Do I Get My Search Bar To Actually Work? August 24, 2022 Post a Comment Hey guys, I've got a search bar and it looks fine, but i don't really know how to make it search the whole of my site... Here's my html code so far: Solution 1: I know you said you want to skip the Google route, but in case you want an interim solution while you go down the path of writing your own code to search your site, this will help (I've expanded on what Brad Christie posted in his comment above): Your HTML from above with element IDs added: <form id="frmSearch" class="search2" method="get" action="default.html" /> <input class="search2" id="txtSearch" type="text" name="serach_bar" size="31" maxlength="255" value="" style="left: 396px; top: 153px; width: 293px; height: 26px;" /> <input class="search1" type="submit" name="submition" value="Search" style=" padding- bottom:20px; left: 691px; top: 153px; height: 23px" /> <input class="search2" type="hidden" name="sitesearch" value="default.html" /> Copy The JavaScript:Baca JugaHow To Close All The Menus Inside An Accordion In Angular 4Read Xml With Jquery/javascript Every 5 SecondsFixed Sidebar, Scrollable Content <script type="text/javascript"> document.getElementById('frmSearch').onsubmit = function() { window.location = 'http://www.google.com/search?q=site:yoursitename.com ' + document.getElementById('txtSearch').value; return false; } </script> Copy Since the JS to power the search is not inside a window.onload function you will need to place the script block after your form. I've tried to simplify this as much as possible to help you get it integrated and working right away. Oh, and don't forget to change "yoursitename.com" in the above JS to your actual domain name. Share You may like these postsHow Is It Possible To Use Aural Style Sheets On Elements?How To Count Json Data Item Ionic2How To Place Text Below Background Image Using Inline Block PropertyResponsive Html Email - 3 Column Layout Spacing For Outlook Post a Comment for "How Do I Get My Search Bar To Actually Work?"
Post a Comment for "How Do I Get My Search Bar To Actually Work?"