二个下拉框的对应问题 第一个下拉框onChange事件触发后将所选的内容提交本页,然后在提交后的页面判断如果我上一页选过这个值,就echo "selected";第二个下拉框根据上页传过来的值作为条件查询数据库,然后列出结果。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //////连级选择function showuser(){ if(form1.catename.selectedIndex==0){ form1.user.style.display="none"; }else{ form1.user.style.display=""; var mcode; mcode=form1.catename[form1.catename.selectedIndex].value; <? for($j=0;$j<count($icate);$j++){ ?> if(mcode=='<?=$icate[$j]?>'){ <? $sql="select count(*) as num from info_admin where icate='".$icate[$j]."'"; $mai_db->query($sql); $mai_db->next_record(); if($mai_db->f("num")!=0){ ?> form1.user.options.length=<?=$mai_db->f("num")?>; <? $sql="select username,icate from info_admin where icate='".$icate[$j]."'"; $mai_db1->query($sql); $i=0; while($mai_db1->next_record()){ ?> form1.user.options[<?=$i?>].text="<?=$mai_db1->f("username")?>"; <?$i++;?> <? } }else{ ?> form1.user.options.length=1; form1.user.options[0].text="还没有斑竹!"; <? } ?> } <? } ?> }}<select name="catename" onchange="showuser()"> <option>请选择...</option>........</select><select name="user" style="display:none"> <option>请选择...</option>...........</select>我没有改代码,直接考过来了,你自己应该能搞定吧! IIS+PHP组件 info 不显示MYSQL 求帮助 关于continue路过几重循环的问题 js关闭页面时弹出信息的问题, $_POST['adddata']能有结果,$_POST['adddata']+1也正确,但和日期相加就不对了,请帮忙 求救,关于时间段的查询 PHPWind出售贴如何统一换成交易币 一个解决不了的问题????////// 在网上下载了个购物车,我改了一下,大家帮我看看哪里错了 如何在文件中存储树结构? PHP验证码不会显示 gb2开了 为什么取得了多个记录,但是在while里面的insert中也只能插入一条记录呢? 我想要做个计数器~,不知道做,请了解的人帮帮忙
function showuser(){
if(form1.catename.selectedIndex==0){
form1.user.style.display="none";
}else{
form1.user.style.display="";
var mcode;
mcode=form1.catename[form1.catename.selectedIndex].value;
<?
for($j=0;$j<count($icate);$j++){
?>
if(mcode=='<?=$icate[$j]?>'){
<?
$sql="select count(*) as num from info_admin where icate='".$icate[$j]."'";
$mai_db->query($sql);
$mai_db->next_record();
if($mai_db->f("num")!=0){
?>
form1.user.options.length=<?=$mai_db->f("num")?>;
<?
$sql="select username,icate from info_admin where icate='".$icate[$j]."'";
$mai_db1->query($sql);
$i=0;
while($mai_db1->next_record()){
?>
form1.user.options[<?=$i?>].text="<?=$mai_db1->f("username")?>";
<?$i++;?>
<?
}
}else{
?>
form1.user.options.length=1;
form1.user.options[0].text="还没有斑竹!";
<?
}
?>
}
<?
}
?>
}
}
<select name="catename" onchange="showuser()">
<option>请选择...</option>
........
</select>
<select name="user" style="display:none">
<option>请选择...</option>
...........
</select>
我没有改代码,直接考过来了,你自己应该能搞定吧!