2016-04-04 56 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