我做了个集成搜素 是单选了 老师说不行,让改成复选框。复选搜索结果显示同一页面  哪个大哥大姐帮改下啊 。万分感谢!<html><head>
<title>中华大百科</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body><form id='form1' name='form1'> 
 <p align="center"> </p>
<p align="center"> </p>
<p align="center"> 
<img border="0" src="百科图片.gif" width="660" height="169"> 
</p>
<p align="center">关键字: 
<input type="text" id="topsearchbox" name="keyword" style="font-size:12px" size="60" onmouseover="this.focus()" onfocus="this.select()" onblur="if(value ==''){value='输入关键字'}" onclick="if(this.value=='输入关键字')this.value=''" value="输入关键字"> 
<input type='submit' id='btntopsearch' onclick="return search()" value=搜索 name="I1" style="font-size: 12px"> 
</p>
<p align="center"><font style="font-size: 12px"> 
<input type='radio' name='stype' value='baidu' checked>百度百科 
 <input type='radio' name='stype' value='britannica'>大英百科
<input type='radio' name='stype' value='wiki'>维基百科 
<input type='radio' name='stype' value='hudong'>互动百科 
</font> 
</td> 
</tr> 
</table> 
</p>
</form><script> 
function search() 
{var keyword = document.form1.keyword.value;var searchtype = document.form1.stype;var chk = 0;var url = "";for(var i=0;i<searchtype.length;i++) 
{if(searchtype[i].checked) 
{chk = i;break;}} 
switch(chk) 
{case 0: 
url = "http://baike.baidu.com/w?ct=17&lm=0&tn=baiduWikiSearch&pn=0&rn=10&word="  + keyword; 
break; 
case 1: 
url = "http://www.britannica.com/bps/search?query" + keyword ; 
break; 
case 2: 
url = "http://zh.wikipedia.org/zh-cn/" + keyword; 
break; 
case 3: 
url = "http://www.hudong.com/wiki/" + keyword; 
default: 

if(chk === 3) 

document.form1.action = url; 
document.form1.method = "post"; 
document.form1.target = "_blank"; 
document.form1.submit(); 
}else 
{window.open(url);}} 
</script> </body></html>

解决方案 »

  1.   

    <head>
    <title>中华大百科</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body><form id='form1' name='form1'>  
     <p align="center"> </p>
    <p align="center"> </p>
    <p align="center">  
    <img border="0" src="百科图片.gif" width="660" height="169">  
    </p>
    <p align="center">关键字:  
    <input type="text" id="topsearchbox" name="keyword" style="font-size:12px" size="60" onmouseover="this.focus()" onfocus="this.select()" onblur="if(value ==''){value='输入关键字'}" onclick="if(this.value=='输入关键字')this.value=''" value="输入关键字">  
    <input type='submit' id='btntopsearch' onclick="return search()" value=搜索 name="I1" style="font-size: 12px">  
    </p>
    <p align="center"><font style="font-size: 12px">  
    <input type='radio' name='stype' value='baidu' checked>百度百科  
     <input type='radio' name='stype' value='britannica'>大英百科
    <input type='radio' name='stype' value='wiki'>维基百科  
    <input type='radio' name='stype' value='hudong'>互动百科  
    </font>  
    </td>  
    </tr>  
    </table>  
    </p>
    </form><script>  
    function search()  
    {var keyword = document.form1.keyword.value;var searchtype = document.form1.stype;var chk = 0;var url = "";for(var i=0;i<searchtype.length;i++)  
    {if(searchtype[i].checked)  
    {chk = i;break;}}  
    switch(chk)  
    {case 0:  
    url = "http://baike.baidu.com/w?ct=17&lm=0&tn=baiduWikiSearch&pn=0&rn=10&word=" + keyword;  
    break;  
    case 1:  
    url = "http://www.britannica.com/bps/search?query" + keyword ;  
    break;  
    case 2:  
    url = "http://zh.wikipedia.org/zh-cn/" + keyword;  
    break;  
    case 3:  
    url = "http://www.hudong.com/wiki/" + keyword;  
    default:  
    }  
    if(chk === 3)  
    {  
    document.form1.action = url;  
    document.form1.method = "post";  
    document.form1.target = "_blank";  
    document.form1.submit();  
    }else  
    {window.open(url);}}  
    </script> </body></html>
      

  2.   

    要是做个单选搜索就是毕业设计的话您的大学也算白念了。复选还有点意思,你用个ajax获取几个站的结果后自己要组装一下,把几个引擎的结果间隔的显示一下。或者偷个懒一个引擎的结果一页,比如选了三个引擎后,第四页的内容其实是第一个引擎的第二页。
      

  3.   

    3楼的大哥,万分感谢您给的提议,但我学电子的 对网站一点也不会。毕业设计选的跑偏了···您能劳驾帮我改一下程序吗?或者用那个ajax帮我组装下  谢谢您了 ,我真是急死了。唉,当初我以为这个设计好做才选的,后悔死了···
      

  4.   

    <input type="checkbox"> 
    httpwebrequest抓取页面数据