让下拉列表又能选择又能输入
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>";
}
}
?>
<?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#中如何使ComboBox不能输入,只能从下拉列表中选择
- 可输入可选择的下拉列表
- 请教:JSP里如何实现下拉组合框,既能从列表中选择也能自由输入,同时输入时自动定位到与已输字符最相符的列表项?
- [原] combobox如何让用户不能输入只能从下拉列表里面选择
- Eclipse中输入存在的类名方法名等不能自动出现下拉列表选择
- [转帖]下拉列表可以输入也可以选择
- asp.net 的ComboBox 可输入可选择下拉列表
- 在WPF的MVVM框架中获取下拉选择列表中的选中项
- 可选择也可输入的下拉列表框,html文件
- [置顶] 下拉列表选择移动组件(jquery)
- 表格中用js左右添加从下拉列表中选择的内容
- [ASP.NET] excel里如何从左侧的下拉列表里进行选择,右侧的另一列直接显示分数
- Eric的日期选择下拉列表小控件
- 可随文本变化而出现不同选择项的文本框+下拉列表选择
- 点击输入关键字 下拉列表
- vue调用百度地图API输入提示示例下拉列表一直被触发问题
- 响应AutoComplete下拉列表的选择事件
- 通过下拉列表快速输入数据
- 使用JQuery UI完成可输入内容且自动匹配的的下拉列表
- 为选择屏幕字段,添加下拉列表