SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    733
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help tweaking new Search field/box/form

    I'm using a php web script with a Search field/box form.

    I had someone redesign/recode the Search field/box.

    It looks improved, but it doesn't work.

    I'd like to use the look of the redesigned box/form and the functionality of the working form code.

    I just don't know how to code it correctly.

    The form that currently works is this one:

    Code:
    <table id="tabX666">
    <tbody>
    <tr><td>
    <form method="get" action="search.php" id="search">
    <input type="hidden" name="type" value="videos">
    <label for="sbi"><font size="6" color="#727272" face="Arial">Search:</font></label>
    <input type="text" name="keyword" id="sbi" value="Enter search words and select: Go!" onfocus="if(this.value==this.defaultValue) this.value='';">
    <input type="image" src="themes/default/images/searchbutton.gif" align="middle" name="B2" value="Search"  />
    </form><br/>
    </td></tr>
    </tbody>
    </table>
    The form/box that looks better/redesigned, but doesn't work, is this one:
    Code:
    <tr><td>
    <table class="srch_bar">
    <tr><td class="search_l"></td>
    <td class="search_m">Simply enter search words and hit Go!
    </td>
    <td class="search_m2">
    <div id="searchField">
    <div id="fieldContainer">
    <div id="leftCurve"></div>
    <form action="search.php">
    <div id="siteSearch">
    <input type="hidden" name="hl" value="en" />
    <input align="middle" type="text" name="q" id="myField"/>
    <div id="rightCurve"></div>
    <input type="image" src="images/go.gif" name="sa" value="Search" id="mySearch"/>
    </div>
    </form>
    </div>
    </div>
    </td>
    <td class="search_r"></td>
    </tr>
    </table>
    </td></tr>
    Can you help me integrate the functioning code correctly into the newly redesigned form/box?

    Thanks

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    change name="q" to name="keyword" and see if that solves it.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, set the form method to get

    Change this from
    Code HTML4Strict:
    <form action="search.php">


    to
    Code HTML4Strict:
    <form method="get" action="search.php">

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and try changing
    Code HTML4Strict:
    <input type="hidden" name="hl" value="en" />

    to

    Code HTML4Strict:
    <input type="hidden" name="type" value="videos"/>

  5. #5
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    calif
    Posts
    733
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all those suggestions.
    It didn't work until I applied all three. Perfect
    Much thanks


Bookmarks

Posting Permissions

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