Drop down box code help.

Started by ApplianceJunk, May 07, 2012, 10:19:55 PM

Previous topic - Next topic

ApplianceJunk

Below I have posted the two sets of codes that we use for two different search boxes.

Each one goes to a different appliance parts website. I have been trying to figure out a way to combine them into one search box that would include a drop down box that would be use to select what site is going to be used.

Could someone help me combine these to forms into one search box with the drop down box?

Thanks,



<!-- RC Search -->

<form name='SmartSearch' method='get' target='_blank' action='http://www.repairclinic.com/Shop-For-Parts'>

<input type='hidden' value='24039' name ='RCAID' />

<input type='text' id='searchText' NAME='searchText' size='65' maxLength='80' />

<input type="submit" value="Search" name="Search" style="background-color:#00FF00;font-size:105%;">

</form>

<!-- RC Search -->







<!-- APP Search -->

<form method="get" action="http://click.linksynergy.com/fs-bin/statform" target="_blank">

<input name="id" value="omv7WULuxaw" type="hidden"><input name="offerid" value="225193" type="hidden">
<input name="bnid" value="1673" type="hidden">
<input name="subid" value="" type="hidden">
<input name="keyword" maxlength="80" size="65" type="text" />
<input type="submit" value="Search" name="Search" style="background-color:#00FF00;font-size:105%;">

</form><IMG width="1" height="1" border="0" src="http://ad.linksynergy.com/fs-bin/show?id=omv7WULuxaw&bids=93887&type=5">

<!-- APP Search -->




Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

ApplianceJunk

Is there a easier way? lol...

I will play around with it on a test site and see if i can get something to work.

Thanks for the reply.


MrPhil

So you have two separate search forms, each with one field to enter the search term and a submit button, that go to different places, and you want to smash them into a single form? Unfortunately, all the names and IDs and hidden fields are different between the two. One approach you could try is to add a couple of radio buttons for "RC Search" and "APP Search" outside of the search form (maybe in their own dummy form). "OnClick" Javascript would replace the the search form (in a <div> innerHTML) content with one or the other search's form and fields.


<form name="selectSearch" action=.....>
  <radio button 1 selected onclick="toRC();">RC Search</radio button>
  <radio button 2 onclick="toAPP();">APP Search</radio button>
</form>
<div id="Search">
<!-- default search is RC -->
<form name='Search' method='get' target='_blank' action='http://www.repairclinic.com/Shop-For-Parts'>
<input type='hidden' value='24039' name ='RCAID' />
<input type='text' id='searchText' NAME='searchText' size='65' maxLength='80' />
<input type="submit" value="Search" name="Search" style="background-color:#00FF00;font-size:105%;">
</form>
</div>
...
<script....>
  function toRC() {..... getElementById('Search').innerHTML = ... RC search form... }
  function to APP() { ..... getElementById('Search').innerHTML = ...APP search form... }
</script>


No promises, and you've got a lot of missing pieces to fill in, but something like that might be the first thing I'd play with if I wanted to do this. You might even leave the "Search" empty, and "onLoad" call toRC(). Just make sure that's consistent with your default radio button setting. Have fun!

ApplianceJunk

QuoteSo you have two separate search forms, each with one field to enter the search term and a submit button, that go to different places, and you want to smash them into a single form?

Yes, that's correct.

Something similar looking to this one.
http://www.appliancepartspros.com/

QuoteOne approach you could try is to add a couple of radio buttons for "RC Search" and "APP Search" outside of the search form (maybe in their own dummy form). "OnClick" Javascript would replace the the search form (in a <div> innerHTML) content with one or the other search's form and fields.

Not a bad idea, will research it some more.

Thanks,

Advertisement: