Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-19-2012, 03:57 PM   PM User | #1
go3asy
New to the CF scene

 
Join Date: Jul 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
go3asy is an unknown quantity at this point
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
Click image for larger version

Name:	search.png
Views:	35
Size:	38.6 KB
ID:	11375  
go3asy is offline   Reply With Quote
Old 11-27-2012, 09:40 AM   PM User | #2
go3asy
New to the CF scene

 
Join Date: Jul 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
go3asy is an unknown quantity at this point
anyone able to help with this? starting on it this week again!
go3asy is offline   Reply With Quote
Old 11-27-2012, 03:55 PM   PM User | #3
KULP
Regular Coder

 
Join Date: Mar 2012
Posts: 166
Thanks: 5
Thanked 11 Times in 11 Posts
KULP is an unknown quantity at this point
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?
KULP is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:00 PM.


Advertisement
Log in to turn off these ads.