Click to See Complete Forum and Search --> : How do I get my search form's results to go to a target frame


mrpickle
03-07-2009, 11:26 PM
I'm having trouble getting my search form's results to open in the frame I want.

The code I currently have is:

<form target="shopFrame" name="searchform" class="style14" onSubmit="return dosearch();">

Search:
<select name="sengines">
<option value="http://members.commissionmonster.com/z/74107/12136/BLURAYSEARCH/http://www.play4me.com.au/search.asp?l=2020&q=">Play4me</option>
<option value="https://members.commissionmonster.com/z/73310/12136/BLURAYSEARCH/http://chaos.com/search.asp?LOC=4000&l=&f=&q=">Chaos</option>
<option value="http://www.sanity.com.au/search/search.asp?Affiliate=564&SValue=">Sanity.com.au</option>
<option value="https://members.commissionmonster.com/z/82639/12136/BLURAYSEARCH/http://www.cdwow.com.au/search?query=">CD WOW</option>
<option value="https://members.commissionmonster.com/z/71593/12136/BLURAYSEARCH/http://www.oo.com.au/search.cfm?SearchIn=0&SearchField=1&keywords=">oo.com.au</option>
<option value="https://members.commissionmonster.com/z/78401/12136/BLURAYSEARCH/http://www.oztion.com.au/buy/auctions.aspx?keyword=">Oztion</option>
<option value="http://rover.ebay.com/rover/1/705-53470-19255-0/1?type=3&campid=5336188838&toolid=10001&customid=&ext=blu-ray&satitle=">eBay.com.au</option>
<option value="http://www.amazon.co.uk/s?index=blended&tag=blurayaustr-21&creative=7034&campaign=1878&adid=1ANRJHZJWC39JDXXWMW9&keywords=" selected="selected">Amazon.co.uk</option>

<option value="http://www.amazon.com/s?index=blended&tag=blurayausblo-20&camp=211041&creative=374001&linkCode=qs1&adid=17DWFNM4MJKE9BW19RE7&keywords=" selected="selected">Amazon.com</option>
<option value="http://www.amazon.ca/s?index=blended&tag=blurayaustr-20&campaign=211045&creative=374009&adid=1M77YHEJ8727GGH6Q5QP&keywords=" selected="selected">Amazon.ca</option>
<option value="http://rover.ebay.com/rover/1/710-53481-19255-0/1?type=3&campid=5336188838&toolid=10001&customid=&ext=blu-ray&satitle=">eBay.co.uk</option>
<option value="http://rover.ebay.com/rover/1/711-53200-19255-0/1?type=3&campid=5336188838&toolid=10001&customid=&ext=blu-ray&satitle=">eBay.com</option>
<option value="http://blurayaustralia.blogspot.com/search?q=">Blog</option>
<option value="http://www.google.com.au/cse?cx=partner-pub-5169642294095779%3A4ydeio-htjq&ie=ISO-8859-1&q=">Google</option>
</select>
For:
<input type="text" name="searchterms">

<input type="submit" name="SearchSubmit" value="GO">
<br />
</form>

My target frame is shopFrame. I don't have much experience with forms and any help would be great.

scragar
03-08-2009, 01:15 AM
If the target is set correctly it should work. Check your names match up.

mrpickle
03-08-2009, 01:26 AM
forgot to mention that this is in the head part of the html file

<script language="JavaScript">
function dosearch() {
var sf=document.searchform;
var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value);
window.location.href = submitto;
return false;
}
</script>

scragar
03-08-2009, 01:29 AM
That's javascript then, and is posted in the wrong forum.

Either way, use Frame.location.href = 'url'; To redirect frames(grabbing the frame using whatever method you think is best, personally I'd use top.frames[...] to ensure compatibility...)

mrpickle
03-08-2009, 08:04 AM
thanks. I changed the line window.location.href = submitto; to top.frames[1].location.href = submitto; and it works