帮我看看这个问题。。。。〔1000分〕 http://expert.csdn.net/Expert/topic/1687/1687993.xml?temp=.4326746这个是两级的,但原理是相同的,你可以参考方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接用程序调数据库,参考一下<body bgcolor="#CCCCCC"><table width="250" border="0" align="center" cellpadding="0" cellspacing="0" style="border-style: outset; border-width: 1"> <form name="form1" method="post" action="<?=$PHP_SELF?>"> <tr> <td><br> <table width="85%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#BBBBBB"> <tr> <td> <div align="center">在您进行此操作前,请先选择一位员工</div> </td> </tr> </table> <br> <table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#666666"> <tr bgcolor="#CCCCCC"> <td align="right">部门:</td> <td> <select name="dept" id="dept" onChange="this.form.submit()"> <option value=''>请选择</option> <? $sql = "select dept_id,dept_name from $dept_tables"; $result = @mysql_query($sql); while($tmp = @mysql_fetch_array($result)) { if($tmp['dept_id'] == $dept)echo "<option value='".$tmp['dept_id']."' selected>".$tmp['dept_name']."</option>"; else echo "<option value='$tmp[dept_id]'>".$tmp['dept_name']."</option>"; } ?> </select> </td> </tr> <tr bgcolor="#CCCCCC"> <td align="right" valign="top">职员:</td> <td> <select name="staff" size="5" id="staff" style="width:100"> <? if(!$dept)echo "<option value=''>请选择部门</option>"; $sql="select * from $staff_tables where dept='$dept' and leavedate is null"; if($leaved==1)$sql="select * from $staff_tables where dept='$dept' and leavedate is not null"; $result = @mysql_query($sql); while($tmp = @mysql_fetch_array($result)) { if($tmp['staffid'] == $staff)echo "<option value='".$tmp['staffid']."' selected>".$tmp['name']."</option>"; else echo "<option value='$tmp[staffid]'>".$tmp['name']."</option>"; } ?> </select> <input name="Sid" size="6" id="Sid" type="hidden" value=""> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"> <input type="button" name="Button" value=" 确定 " onClick="formSubmit(this.form);"> <input type="button" name="Button2" value=" 取消 " onClick="self.location='index.php?dept_id=<?=$dept?>'"> </div> </td> </tr> </table> <br> </td> </tr> </form></table></body></html> 你可以找个javascript特效呀,可者把你的字段填入数据库里,然后调用呀! 正则匹配 怎样验证文本框里有没有非法字符呢 想实现一个JS效果,大侠们帮帮忙 请大家帮我一个忙,我快要疯掉了 这个程序那里出错? 急问高手:在win98下如何进行asp测试????在线等待 100分求救:div的滚动条如何滚动到相应的位置? 怎么判断一个窗口是否已经打开? 如何在提交时自动添加数据? 找兼职 如何使页面中的弹出的小窗口可以和QQ 一样 一直位于最上层 简单问题
直接用程序调数据库,参考一下<body bgcolor="#CCCCCC">
<table width="250" border="0" align="center" cellpadding="0" cellspacing="0" style="border-style: outset; border-width: 1">
<form name="form1" method="post" action="<?=$PHP_SELF?>">
<tr>
<td><br>
<table width="85%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#BBBBBB">
<tr>
<td>
<div align="center">在您进行此操作前,请先选择一位员工</div>
</td>
</tr>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#CCCCCC">
<td align="right">部门:</td>
<td>
<select name="dept" id="dept" onChange="this.form.submit()">
<option value=''>请选择</option>
<?
$sql = "select dept_id,dept_name from $dept_tables";
$result = @mysql_query($sql);
while($tmp = @mysql_fetch_array($result))
{
if($tmp['dept_id'] == $dept)echo "<option value='".$tmp['dept_id']."' selected>".$tmp['dept_name']."</option>";
else echo "<option value='$tmp[dept_id]'>".$tmp['dept_name']."</option>";
}
?>
</select>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="right" valign="top">职员:</td>
<td>
<select name="staff" size="5" id="staff" style="width:100">
<?
if(!$dept)echo "<option value=''>请选择部门</option>";
$sql="select * from $staff_tables where dept='$dept' and leavedate is null";
if($leaved==1)$sql="select * from $staff_tables where dept='$dept' and leavedate is not null";
$result = @mysql_query($sql);
while($tmp = @mysql_fetch_array($result))
{
if($tmp['staffid'] == $staff)echo "<option value='".$tmp['staffid']."' selected>".$tmp['name']."</option>";
else echo "<option value='$tmp[staffid]'>".$tmp['name']."</option>";
}
?>
</select>
<input name="Sid" size="6" id="Sid" type="hidden" value="">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center">
<input type="button" name="Button" value=" 确定 " onClick="formSubmit(this.form);">
<input type="button" name="Button2" value=" 取消 " onClick="self.location='index.php?dept_id=<?=$dept?>'">
</div>
</td>
</tr>
</table>
<br>
</td>
</tr>
</form>
</table>
</body>
</html>