Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- search form - open in new window


em007 - 3:47 pm on Mar 7, 2012 (gmt 0)


Hi, I found this script on the net. I would like it to open in a new tab/window.

How can this be achieved?


<script type="text/javascript">
function dosearch() {
var sf=document.searchform;
for (i=sf.sengines.length-1; i > -1; i--) {
if (sf.sengines[i].checked) {
var submitto = sf.sengines[i].value + escape(sf.searchterms.value);
}
}
window.location.href = submitto;
return false;
}
</script>



<form name="searchform" onSubmit="return dosearch();">
Search:<br />
<input name="sengines" type="radio" value="http://www.google.com/search?q="> Google<br />
<input name="sengines" type="radio" value="http://www.altavista.com/web/results?q="> Alta Vista<br />
<input name="sengines" type="radio" value="http://www.dogpile.com/info.dogpl/search/web/"> Dogpile<br />
<input name="sengines" type="radio" value="http://search.yahoo.com/search?p="> Yahoo!<br />
For:
<input type="text" name="searchterms">
<input type="submit" name="SearchSubmit" value="Search">
</form>


Thread source:: http://www.webmasterworld.com/javascript/4426068.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com