永发信息网

怎么选择框做成下拉框?

答案:2  悬赏:40  手机版
解决时间 2021-07-17 23:17

<form name="search" method="post" action="Article/search.asp">
<input name="Keyword" type="text" id="Keyword" value="关键字" size="16" maxlength="50">
<input name="Submit" type="submit" id="Submit" value="搜索">
<br>
<input name="Channel" type="radio" value="Article" checked onClick="javascript:document.search.action='Article/search.asp';document.search.Field.value='Title';">
文章
<input type="radio" name="Channel" value="Soft" onClick="javascript:document.search.action='Soft/search.asp';document.search.Field.value='SoftName';">
下载<br>
<input type="radio" name="Channel" value="Photo" onClick="javascript:document.search.action='Photo/search.asp';document.search.Field.value='PhotoName';">
图片
<input type="radio" name="Channel" value="bbs" onClick="javascript:document.search.action='bbs/queryresult.asp?sType=2&pSearch=1&SearchDate=ALL&Stable=bbs1&boardid=0';document.search.Field.value='Title';">
论坛<br>
<input name="Field" type="hidden" id="Field" value="Title">
</form>



上面的是选择的,我想做成下拉,怎么弄呢?

最佳答案

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<input id="keyword" value="" />
<input id="submitSearch" onclick="submitSearch()" type="button" value="搜索" />
<select id="search" name="search">
<option value="atricle">文章</option>
<option value="photo">图片</option>
<option value="download">下载</option>
</select>


<script type="text/javascript">
function submitSearch() {
var keyword = document.getElementById('keyword').value;
var option = document.getElementById('search').value;
if (keyword == '') {
alert('请输入关键字');
return;
}
var url = option + "/serach.asp?keyword=" + escape(keyword);
location = url
}
</script>


</body>
</html>

全部回答
<input id="keyword" value="" /> <input id="submitSearch" onclick="submitSearch()" type="button" value="搜索" /> <select id="search" name="search"> <option value="Article">文章</option> <option value="Photo">图片</option> <option value="Soft">下载</option> </select> <input name="Field" type="hidden" id="Field" value="Title"> <script type="text/javascript"> function submitSearch() { var keyword = document.getElementById('keyword').value; var option = document.getElementById('search').value; if (keyword == '') { alert('请输入关键字'); return; } var Field if (option=="Article"){ Field="Title"; } if (option=="Photo"){ var Field="PhotoName"; } if (option=="Soft"){ var Field="SoftName"; } var url = option + "/serach.asp?keyword=" + escape(keyword)+"&Field="+Field; location = url } </script>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
今年中超哪个队会赢得冠军
请问为什么播下的种子会不翼而飞呢?
寻冒险之地`
李智楠现在在做什么?
买数码相机,又能便宜,功能又好。到底买什么
彩虹糖mp3地.... 可以放空间的那种。
我只是记得其中有一句歌词是《你是我无法言说
怎么才能在QQ空间农场里面删除好友?
我电脑的C盘里装了三个相同系统,怎么去掉多
穿越火线更新4.8之后游戏FPS不稳定是怎么回事
什么衣服和裤子又便宜又好看???
怎样免费稿空间 啊
601958后市操作?
什么银行的网银不需要使用网银盾
怎么处理复杂的人际关系?
推荐资讯
09年11月出生的女孩 姓王 帮忙起个名字吧 谢
怎么能快速升级DNF
《如梦年华》歌曲的串词
从龙岗到东莞黄江坐什么车到
交通违章1230是什么?
李子惠好听还是李念好听?
为什么我的U盘属性已用1G多,可是东西都不见
上海衡上路的详细情况
注销银行卡的问题
SoS: 深圳市关内的有名咖啡厅有哪些?详细地
那孕妇用药泡下面对胎儿有没有影响
女性安全期怎么算?
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?