Search Form

Discussion in 'Web Design & Coding' started by sean.ferguson, Feb 1, 2004.

  1. sean.ferguson

    sean.ferguson Moderator Folding Team

    Messages:
    1,693
    Location:
    Fife; Scotland
    i am in the process of re-designing my website, one of the functions is a form the searches google, i have it working but there is one bug that i can't get fixed.

    this is the code i have for the form
    Code:
        <form id="search" action="http://www.google.com/search" method="get"> 
          <input name="q" type="text" size="10"> 
          <a href="">search</a> 
        </form> 
    now, if you type something into the text box and press enter, it searches google fine with no problems whatso ever, but the..
    Code:
    <a href="">Search</a>
    i dont know what i am supposed to have in the link?

    any help will be greatly apprieciated :)
     
  2. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Code:
    <input type="submit" value="Search" />
    You can change the button to an image too (Wouldn't recommend that, tis just annoying :p) I'm pretty sure to submit a form with a text link would require some form of JavaScript.
     
  3. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Apparently this works
    Code:
    <a href="javascript:this.form.submit()">submit this form</a> 
    
     
  4. sean.ferguson

    sean.ferguson Moderator Folding Team

    Messages:
    1,693
    Location:
    Fife; Scotland
    will try that :)
     
  5. sean.ferguson

    sean.ferguson Moderator Folding Team

    Messages:
    1,693
    Location:
    Fife; Scotland
    nope didnt work :(
     
  6. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    Messages:
    5,518
    Location:
    England
    the first bit of code SPeedY_B said works fine when i try it
    Code:
    <input type="submit" value="Search" >
     
  7. sean.ferguson

    sean.ferguson Moderator Folding Team

    Messages:
    1,693
    Location:
    Fife; Scotland
    do'h my bad, im sorry speedy it does work, thanks Khayman for drawing my attention to it again :D i missed />