87,907
社区成员
发帖
与我相关
我的任务
分享
<select name="comp">
<option value="">公司列表</option>
<?php
$sql = "select id,name from company";
$result = mysql_query($sql);
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_assoc($result)) {
echo "<option value={$row['id']}>{$row['name']}</option>";
}
}
mysql_free_result($result);
?>
</select>
<table>
<tr>
<th>用户组类型</th>
<td>
<input type="radio" name="groupid" value="5" onClick="check(this.value);" checked>
普通用户
<input type="radio" name="groupid" value="10" onClick="check(this.value);">
营销员
</td>
</tr>
<tr id="cmplist" style=" display:none">
<td>
<select name="comp">
<option value="">公司列表</option>
<option value="1">公司A</option>
<option value="2">公司B</option>
<option value="3">公司C</option>
</select>
</td>
</tr>
</table>
<script language="javascript">
<!--
function check(val){
if(val==10){
document.getElementById('cmplist').style.display='';
}else {
document.getElementById('cmplist').style.display='none';
}
}
-->
</script>