General Community > Scripting Help
Drop down box code help.
(1/1)
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,
--- Code: ---
<!-- 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 -->
--- End code ---
--- Code: ---
<!-- 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 -->
--- End code ---
Kays:
Here's something to consider. Selectable Search Option
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.
--- Code: ---<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>
--- End code ---
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:
--- Quote ---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?
--- End quote ---
Yes, that's correct.
Something similar looking to this one.
http://www.appliancepartspros.com/
--- Quote ---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.
--- End quote ---
Not a bad idea, will research it some more.
Thanks,
Navigation
[0] Message Index
Go to full version