|
以下代码if else 变量op document.write 错去在哪里?恳请帮忙
<td align="center" class="search">
<form action="[!--news.url--]e/search/index.php" method="post" name="searchform" id="searchform">
<table border="0" cellspacing="6" cellpadding="0">
<tr>
<td><strong>站内搜索:</strong>
<input name="keyboard" type="text" size="32" id="keyboard" class="inputText" />
<input type="hidden" name="show" value="title" />
<input type="hidden" name="tempid" value="1" />
<select name=“tbname”>
<option value="news">资讯</option>
<option value="m1">d1v1.com 1</option>
<option value="m2">d1v1.com 2</option>
<option value="m3">d1v1.com 3</option>
<option value="m4">d1v1.com 4</option>
<option value="m5">d1v1.com 5</option>
<option value="m6">d1v1.com 6</option>
<option value="m7">d1v1.com 7</option>
</select>
<script type="text/javascript">
var op=document.getElementById('tbname').value;
alert(op);
if (op=="m1")
{
document.write('<input type="hidden" name="classid" value="102,4,2,3,50,6,7">');
}
else if (op =="m2")
{
document.write('<input type="hidden" name="classid" value="4,2,3,50,6,7,102">');
}
else if (op=="news") {
document.write('<input type="hidden" name="classid" value="2,3,50,6,7">');
}
else (op=="m4") {
document.write('<input type="hidden" name="classid" value="50,6,7">');
}
</script>
</td>
<td>
<input type="image" class="inputSub" src="[!--news.url--]skin/default/images/search.gif" />
</td>
<td><a href="[!--news.url--]search/" target="_blank">高级搜索</a></td>
</tr>
</table>
</form>
</td>
但似乎 document.write('<input type="hidden" name="classid" value="102,4,2,3,50,6,7">');没有执行。
单独<input type="hidden" name="classid" value="102,4,2,3,50,6,7"> 有效。
|
|
开门芝麻网
部分内容由网友发布或收集于互联网,如有侵权,请联系QQ/微信76815288,第一时间删除!(开门芝麻网 sns.d1v1.com)
|