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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Thanked 0 Times in 0 Posts

    need help with my search box please ...

    Hi all, i would like some help with something if you would be so kind.

    I have this search box in my header ..

    With this code.

    <div style="padding:5px;">
    <form method="get" action="http://www.xxxxxxx.com/yyyyyy/">
    <table style="width:50%;" cellpadding="5">
    <td style="vertical-align:top;font-size:9pt;">
    input type="text" value="search ..." id="search" onkeyup="searchSel()">
    <SELECT id="groups">
    <option value="">Select:</option>
    <option value="user">Users</option>
    <option value="event">Events</option>
    <option value="gallery">Gallery</option>
    <input type="submit" value="Go" class="mainmenu66" onmouseover="this.className='mainmenu77';" onmouseout="this.className='mainmenu66';"

    And am trying to do 2 things.

    1. Remove the 'go' button, and have it execute the search when the user selects an option from the drop down box.

    2. The 'action' of the form to goto a different place depending on the users selection within the drop down box -

    So; if they select 'Users'.. it goes to xxxxxx.com/searchusers, if they select events it goes to xxxxx.com/searchevents etc.

    Can anyone give me some ideas/code as to how i can implement this, i can edit and code VERY basic PHP but this is way beyond my level. Or, if anyone has some example code or something to help me along that would be awesome too? Have't had much luck with google when i searched for stuff ...

    Thanks to any and all who input into the thread


    EDIT: This is within the phpFox content management system if tat has any bearing on things. It is in one of the tpl files, but php works within it too. Just not sure how to implement A: In the PHP, and also how to integrate that code into my tpl file. Is all very confusing hehe :-\

  2. #2
    Regular Coder
    Join Date
    Mar 2006
    Thanked 0 Times in 0 Posts
    You actually neeed a javscript for this. if possible, move ur post to the javascript forum. Bet you will get some help there.......

  3. #3
    Supreme Master coder!
    Join Date
    Jun 2003
    Cottage Grove, Minnesota
    Thanked 1,170 Times in 1,161 Posts
    You would be looking for a Javascript to do your select box enter key ...

    If someone has Javascripting turned-off, or uses their keyboard for
    navigation (instead of the mouse), there would be some problems.

    Look at a Google search like this:

    Item 2 ----
    That's going to be harder to do. I think you'll have to jump to a PHP
    script that views the select box value and redirects based on that value.

  4. #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Thanked 637 Times in 625 Posts
    For Item 2 you can change the "action" parameter of your form via Javascript, so it's possible to do without PHP.


Posting Permissions

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