HTML Site Search

Posted on 2011-10-29
Last Modified: 2012-05-12
I have a Template from Template Monster with a "Site Search" section in the top.

This is a straight forward HTML site and I'm wondering what to do with this?
<form id="form-top" action="" method="post" enctype="multipart/form-data">
                    <div class="form-top">					
                        <span><input name="name" value="Site Search" onBlur="if(this.value=='') this.value='Site Search'" onfocus="if(this.value =='Site Search' ) this.value=''" /></span>
                        <a href="#" onclick="document.getElementById('form-top').submit()"></a>									

Open in new window

Question by:lrbrister
    LVL 7

    Expert Comment

    Really, you need something on the server side to handle this. The code you have submits the string to a script that does the search. Doing it on the client side isn't effective, because they'd have to download the entire text content of the website, search it, generate the code needed to present the results, and have the browser load it. Just isn't feasible.
    LVL 6

    Accepted Solution

    Is there any reason you'd be wanting a search box for your website?

    If yes, then the (action="") would then be hooked up to either some server side code or another page on your web site with search functionality.

    Try reading this page for ways of getting that going easily:
    LVL 7

    Expert Comment

    Also I should mention, unless you plan on dealing with HTML5, it really isn't possible to do anything like what you want with pure HTML, since HTML is meant for display.

    Author Closing Comment


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now