高分!分类提交表单问题..
caiqh 2002-11-15 11:23:56 有一个分类搜索的表单,根据Radio选择的不同递交不同参数到不同地址,但无法取到radio的状态或者值...
表单如下:
<form name="searchform">
<td valign="bottom" height="40">关键字:
<input type=hidden name=actionid>
<input type="text" name="search" class="textfile1">
<input type="radio" name="SearchRadio" checked value="ghxx">供货信息
<input type="radio" name="SearchRadio" value="cgxx">采购信息
<input type="radio" name="SearchRadio" value="cpzs">产品展示
<input type="radio" name="SearchRadio" value="hyzx">行业资讯
<img style="cursor:hand" border="0" name="ImageSearchSubmit" src="images/suosuo.gif" onClick="javascript:searchsubmit()" width="46" height="21">
</td>
</tr>
</form>
表单递交函数searchsubmit()如下:
function searchsubmit(){
if(document.searchform.SearchRadio.value=="ghxx"){
//不知道document.searchform.SearchRadio.value怎么为空??
//改成if(document.searchform.SearchRadio[0].checked){也不行
document.searchform.actionid.value = "851:861"
document.searchform.action = "a.jsp";
}else{
document.searchform.actionid.value = "951:961"
document.searchform.action = "b.jsp";
}
document.searchform.method="get"
document.searchform.submit();
}