Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
Hi
I want to implement search content in my website.
I added JavaScript code but its triggering to index page.


Please anyone help me on this.

I added this code in html
HTML
<div class="search-box">
    <div id="sb-search" class="sb-search">
        <form>
            <input class="sb-search-input" placeholder="Enter your search term..."
                    type="search" name="search" id="search">
            <input class="sb-search-submit" type="submit" value="">
            <span class="sb-icon-search"> </span>
        </form>
    </div>
</div>




and added this in JavaScript
HTML
<script src="js/classie.js"></script>
<script src="js/uisearch.js"></script>
<script>
    new UISearch( document.getElementById( 'sb-search' ) );
</script>


As i am working new in html website. Please help me.
Posted
Updated 1-Dec-15 23:26pm
v4
Comments
Sreekanth Mothukuru 25-Nov-15 2:21am    
I think you can use "Google internal site search" for your website all if it contains a static content. Otherwise go and implement your own logic.
SukirtiShetty 25-Nov-15 3:40am    
i tried using javascript but it simply redirecting to the index page.

1 solution

use Google's search to your search link. You can use this to create a custom google's search for your website and then paste it on every page you want to include the search box, inside the div tags of course.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900