/    Sign up×
Community /Pin to ProfileBookmark

How do I get my search form’s results to go to a target frame

I’m having trouble getting my search form’s results to open in the frame I want.

The code I currently have is:

[code=html]<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>[/code]

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

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@scragarMar 08.2009 — If the target is set correctly it should work. Check your names match up.
Copy linkTweet thisAlerts:
@mrpickleauthorMar 08.2009 — forgot to mention that this is in the head part of the html file

[code=html]<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>[/code]
Copy linkTweet thisAlerts:
@scragarMar 08.2009 — That's javascript then, and is posted in the wrong forum.

Either way, use [b]Frame[/b].location.href = 'url'; To redirect frames(grabbing the frame using whatever method you think is best, personally I'd use [b]top.frames[...][/b] to ensure compatibility...)
Copy linkTweet thisAlerts:
@mrpickleauthorMar 08.2009 — thanks. I changed the line [code=html]window.location.href = submitto;[/code] to [code=html]top.frames[1].location.href = submitto;[/code] and it works
×

Success!

Help @mrpickle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...