CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    112

    [RESOLVED] Google search box won't search

    I'm using IE8 to test

    Hi, I'm trying to add a google search box (in a table) to my web page, but for some reason it the input button links to the page I am currently on. The strange part is that I put the same exact code in another cell right next to the other google search box and that one works wonderfully while the first one still links to the current page. It is the same with any search engine (yahoo, bing, ask), the first search box links to the current page and the rest work great. Here is the code I use:

    Code:
    <form method="get"action="http://www.google.com/search">
    <input style="width:140px"type="text"name="q"size="31"maxlength="255"value=""/><br/>
    <input type="submit"value="Google Search"/>
    Thanks.

    **EDIT**

    I think I may have found something. I made an html page with a table and two search boxes, and it worked fine. When I put it into an .aspx file the first search box didn't work. So I'm wondering if the .aspx file is messing it up. Still don't know what to do about it though...
    Last edited by vandel212; June 6th, 2010 at 11:59 PM.
    - It's a long way to the top if you want to rock n' roll - AC/DC

    Check out my band and support the music:
    www.blueruinmusic.com

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Google search box won't search

    Well...to start off, you're missing some serious spaces within the one tag.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Feb 2009
    Posts
    112

    Re: Google search box won't search

    Quote Originally Posted by PeejAvery View Post
    Well...to start off, you're missing some serious spaces within the one tag.
    Don't worry the spaces are there I just didn't notice when I copied and pasted into the thread. Anyway I figured out the problem is that the code was in the <form> tag for the whole page. So I moved the </form> tag to an appropriate spot and it works wonderfully.

    Thanks.
    - It's a long way to the top if you want to rock n' roll - AC/DC

    Check out my band and support the music:
    www.blueruinmusic.com

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured