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

    Arrow Custom search form passing search onto another site depending on dropdown...

    OK, we are building an Intranet using wordpress and the template has its search bar on the header, with a drop down allowing selection of specific post category to search or search everything (renamed to Intranet) we dont need the category search,

    If you see the screenshot we would just like to have the drop down to have the Intranet option to search the wordpress site (cant link to it, its internal)

    Heres what I need help with though...I would like to add a second option to the dropdown that changes the search to pass a query onto an external site and seach , the external site being http://www.qifv.scot.nhs.uk/CE_ClinicalGuidelines.asp

    The seach form on this site actions CE_SearchResults.asp. The input of the form name is "keywords"

    Now this code on an internal page allows this to optn up the external site with my search results,

    Code:
    <form method=post action=http://www.qifv.scot.nhs.uk/CE_SearchResults.asp>
    <input type=text style="width:350px" name=keywords>
    <input type=submit name=submit value=Search>
    </form>
    So the code on the wordpress search form is,


    Code:
    <div id="search_right">
        <div id="search_bg">
            <form class="searchform" method="get" action="<?php echo get_option('home'); ?>">
                <fieldset>
                    <legend class="hidden">Search form</legend>
                    <div class="input-holder">
                        <input class="search" name="s" type="text" placeholder="Search Here"/>
                    </div>
                    <?php wp_dropdown_categories('show_option_all=Intranet&orderby=name&depth=1');?>
                    <button value="submit" class="search_btn">Search</button>
                </fieldset>
            </form>
        </div>
    </div>
    As you can see from this section, is the dropdown

    PHP Code:
     <?php wp_dropdown_categories('show_option_all=Intranet&orderby=name&depth=1');?>
    Also the form input name in wordpress is "s" so the external site doesnt recognise that unless its name is Keywords but I cant change that which in turn breaks wordpress search.

    So is there a way to have that drop down with 2 options, Intranet (search the wordpress as it is) and Clinical Guideliens option which will pass the query onto "action=http://www.qifv.scot.nhs.uk/CE_SearchResults.asp" with the input field name "keywords" , but ONLY if the "Clinical Guidelines" option is selected from the dropdown? Not sure if it can be done with an IF or something?

    If anyone could help with this that would be great, let me know If im making no sense!!
    Attached Thumbnails Attached Thumbnails Custom search form passing search onto another site depending on dropdown...-search.png  

  • #2
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone able to help with this? starting on it this week again!

  • #3
    Regular Coder
    Join Date
    Mar 2012
    Posts
    168
    Thanks
    5
    Thanked 11 Times in 11 Posts
    You just need to send it different urls for the respected searches. Do you already have the searches set up for each of those options?


  •  

    Posting Permissions

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