where is your <FORM>? how do you do the search? GET or POST? if you are using GET, you could do
<a href="YourSearchPage.asp?word=金庸&sel=wuxia">金庸</a>if you are using POST:<form name="form1" method="post">
<!--other stuffs here-->
</form><a href="#" onclick="doSubmit('金庸','wuxia')">金庸</a>
<script language="javascript">
function doSubmit(sWord, sCat)
{
document.form1.word.value = sWord;
for (var i=0; i < document.form1.sel.length; i++)
if (document.form1.sel[i].value == sCat)
{
document.form1.sel[i].checked=true;
break;
}
document.form1.submit();
}
</script>
<a href="YourSearchPage.asp?word=金庸&sel=wuxia">金庸</a>if you are using POST:<form name="form1" method="post">
<!--other stuffs here-->
</form><a href="#" onclick="doSubmit('金庸','wuxia')">金庸</a>
<script language="javascript">
function doSubmit(sWord, sCat)
{
document.form1.word.value = sWord;
for (var i=0; i < document.form1.sel.length; i++)
if (document.form1.sel[i].value == sCat)
{
document.form1.sel[i].checked=true;
break;
}
document.form1.submit();
}
</script>
============================
<form method="post" action="login.php" name="form1">
<table>
<tr>
<td height="35" valign="bottom"><img src="image/yonghudenglu.gif" width="150" height="20"></td>
</tr>
<tr>
<td height="1" valign="bottom" background="image/hlinewhite.gif"> </td>
</tr>
<tr>
<td valign="bottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td align="left" height="30" class="paddingleft" width="60">用户名:</td>
<td height="30">
<input type=text class=form1 size=8 name="username1">
</td>
</tr>
<tr valign="bottom">
<td align="left" class="paddingleft" width="60">密 码:</td>
<td>
<input type=password class=form1 size=8 name="password1">
</td>
</tr>
<tr valign="bottom" align="left">
<td height="30" class="paddingleft" width="60"> </td>
<td style=padding-left:32px height="30" class="paddingleft">
<input type=image src="image/denglu.gif" width="35" height="18" name="submit">
</td>
</tr>
<tr valign="bottom">
<td align="left" style=padding-left:10px height="20" width="60"><a href="zhuce.php" class="link1">注册用户</a></td>
<td style=padding-left:20px height="20"><a href="yonghuziliao.php" class=link1>用户资料</a></td>
</tr>
</table>
</td>
</tr></form>
<form method="post" action="search.php" name="form2">
<tr>
<td valign="bottom" height="35"><img src="image/gequsousuo.gif" width="150" height="20"></td>
</tr>
<tr>
<td height="1" background="image/hlinewhite.gif" valign="bottom"> </td>
</tr>
<tr>
<td valign="bottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="30" class="paddingleft" width="60">关键字:</td>
<td height="30"> <input type=text class=form1 size=8 name="word">
</td>
</tr>
<tr valign="bottom">
<td class="paddingleft" width="60" height="23">类 别:</td>
<td height="23"> <input type="radio" name="sel" value="singer" checked>
武侠</td>
</tr>
<tr valign="bottom">
<td width="60"> </td>
<td>
<input type="radio" name="sel" value="name" > 科幻</td>
</tr>
<tr valign="bottom">
<td> </td>
<td><input type="radio" name="sel" value="album" >
其他</td>
</tr>
<tr valign="bottom">
<td width="60" height="30"> </td>
<td height="30" style=padding-left:30px> <input type=image src="image/sousuo.gif" width="35" height="18" name="submit2">
</td>
</tr>
</table>
</td>
</tr></form>
==========================================
请问,楼上的方法要作如何的修改,才可以达到目的?谢谢
<tr>
<td valign="bottom">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="30" class="paddingleft" width="60">关键字:</td>
<td height="30"> <input type=text class=form1 size=8 name="word">
</td>
</tr>
<tr valign="bottom">
<td class="paddingleft" width="60" height="23">类 别:</td>
<td height="23"> <input type="radio" name="sel" value="wuxia" checked>
武侠</td>
</tr>
<tr valign="bottom">
<td width="60"> </td>
<td>
<input type="radio" name="sel" value="kehuan" >
科幻</td>
</tr>
<tr valign="bottom">
<td> </td>
<td><input type="radio" name="sel" value="qita" >
其他</td>
</tr>
<tr valign="bottom">
<td width="60" height="30"> </td>
<td height="30" style=padding-left:30px> <input type=image src="image/sousuo.gif" width="35" height="18" name="submit2">
</td>
</tr>
</table>
</td> </tr></form>
<a href="#" onclick="doSubmit('金庸','wuxia')">金庸</a>
<script language="javascript">
function doSubmit(sWord, sCat)
{
var form = document.form2;
form.word.value = sWord;
for (var i=0; i < form.sel.length; i++)
if (form.sel[i].value == sCat)
{
form.sel[i].checked=true;
break;
}
form.submit();
}
</script>
<input name="bookname" type="text" id="bookname" value="Book and Sword">
</form>
<a href="javascript:BookSearch.submit()">!Search</a>
^^^^^^^^^^^^^^^^^^^
最简单的方法了。