选择显示 点击隐藏 显示
<script language="javascript"> function doit(){ var sel_val=$("#type").val(); if (sel_val=='') { $("#bigClassId1").hide(); $("#bigClassId2").hide(); } if (sel_val==1) { $("#bigClassId1").show(); $("#bigClassId2").hide(); } if (sel_val==2) { $("#bigClassId2").show(); $("#bigClassId1").hide(); } } </script> <select name="type" id="type" onchange="doit();"> <option value="">店铺</option> <option value="1">无</option> <option value="2">有</option> </select> <select name="bigClassId1" id="bigClassId1" style="display:none;"> <option value="">点就赚大类</option> <?php $rs=query("SELECT id,categoryName FROM tb_ecategory WHERE grade=1 AND categoryId=0 AND state = 0"); while($row=fetch_array($rs)){ echo "<option value=".$row["id"].">".$row["categoryName"]."</option>"; } free_result($rs); ?> </select> <select name="bigClassId2" id="bigClassId2" style="display:none;"> <option value="">来就赚大类</option> <?php $rs=query("SELECT id,categoryName FROM tb_ecategory WHERE grade=2 AND categoryId=0 AND state = 0"); while($row=fetch_array($rs)){ echo "<option value=".$row["id"].">".$row["categoryName"]."</option>"; } free_result($rs); ?> </select>
浙公网安备 33010602011771号