您的位置:首页 > 其它

让下拉列表又能选择又能输入

2004-12-30 16:19 375 查看
将下列代码复制到你的代码中,再修改成自己需要的

<?if ($FH_CP<>""){
$seek_cp="select gg,cp from bom where lh='$FH_CP' ";
$result_cp=@pg_exec($link,$seek_cp);
$GG=trim(pg_result($result_cp,0,"gg"));
$CP=trim(pg_result($result_cp,0,"cp"));
$C_G=$CP.' '.$GG;

echo "<option selected value=/"$FH_CP/">$C_G</option>"; }?>
<?for($j=0;$j<$row_fh;$j++){
$gg_fh=trim(pg_result($result_fh,$j,"gg"));
$cp_fh=trim(pg_result($result_fh,$j,"cp"));
$seek_lh="select * from bom where cp='$cp_fh' and gg='$gg_fh' ";
$result_lh=pg_exec($link,$seek_lh);
$lh_fh=trim(pg_result($result_lh,0,"lh"));
$cp_gg=$cp_fh.' '.$gg_fh;

if($lh_fh==$FH_CP){
echo "<option selected value=/"$lh_fh/">$cp_gg</option>";
}
else{
echo "<option value=/"$lh_fh/">$cp_gg</option>";
}
}
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c