<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>