Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Thanked 0 Times in 0 Posts

    Search bar - link form

    I'm a newbie to the art of coding but I want to code a form box into a search box type thing. The closest I've found to the link box I want is this:
    <form action="#">
    Type in a URL, and hit the Go! button to go there!
    <br />
    <input name="the_url" type="text" value="http://" size="25" />
    <input type="button" value="Go!" onClick="window.location=this.form.the_url.value" />

    What I want my search bar/link bar is that when you type in say "joe" i want it to go to page ../joe.htm (I'm using microsoft frontpage btw). Is there anyway I can code that somehow? Any help would be great. Thank you in advance !

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <script type="text/javascript">
    function searchIt()
    var yoursite = 'http://www.yoursite.com/';
    var suffix = '.htm';
    window.location = yoursite + document.forms[0].goto.value + suffix;
    return false;
    <form action="#" method="post" onsubmit="return searchIt()">
    <input type="text" name="goto" value="Enter Page Name Here" onfocus="if(this.value == this.defaultValue) this.value = ''" onblur="if(this.value == '') this.value = this.defaultValue">
    <input type="submit" value="Submit">


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts