2016-04-04 59 views
0

我希望访问者能够在新选项卡打开搜索框时打开复选框。目标_Blank在选择菜单

而且我无法在选择菜单中使TARGET =“_ blank”工作。 在此先感谢!

<html> 
<head> 
<title></title> 
<script language="JavaScript"> 
function dosearch() { 
var sf=document.F; 
var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchit.value); 
window.open(submitto,'bottom'); 
return false; 
} 
</script> 
</head> 

<body onLoad="document.F.searchit.focus();"> 
<table width="100%" border="0"><tr align="left" valign="top"><td width="200"> 
<form name="guideform"> 
In: 
<select name="guidelinks" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value + document.F.searchit.value"> 
<option value="downloads.html?downloads=selected&amp;searchit=">Downloads</option> 
</select> 
</form></td> 
<td><form name="F" onSubmit="return dosearch();"> 
Search: 
<select name="sengines"> 
<option value="http://download.cnet.com/s/" >Download.com</option> 
<option value="http://filehippo.com/search?q=" TARGET="_blank">Filehippo</option> 
</select> 
For: 
<input name="searchit" value="" type="text" size="45"> 
<input type="submit" name="SearchSubmit" value="Search"> 
<input type="checkbox" name="Newtab" target="_blank">New tab 
</form></td> 
<td width="1"></td></tr></table> 
</body> 
</html> 
+0

新标签 <选项值=“http://filehippo.com/搜索?q =“TARGET =”_ blank“> Filehippo – Adam

+0

只是一个友好的提示,你可能想要阅读本页:[The How-To-Ask Guide](https://stackoverflow.com/help/how-提问),因此您始终可以确定您的问题很容易回答并且尽可能清晰。一定要包括你为解决你遇到的问题所做的任何努力,以及当你尝试修复这些问题时发生了什么。另外不要忘记你的代码和任何错误信息! –

+0

你说你无法让它工作,这意味着它不能工作,但你不解释发生了什么。什么都没有发生?是否发生错误?请包括这些细节。 –

回答

0

尝试:

<option> 
    <a href="http://filehippo.com/search?q=" target="_blank">Filehippo</a> 
</option> 
+0

无效.. – Adam

+0

示例网页: http://erikwennerstrand.se/sok/index.html – Adam