龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 操作系统 > LINUX系统 >

[原]select下拉框美化

时间:2013-01-16 15:24来源:未知 作者:admin 点击:
分享到:
文件下载: 华为网盘下载:http://dl.dbank.com/c0pvz9djzx !--下拉框开始-- link href=?php echo DT_PATH; ?file/select/reset.css rel=stylesheet type=text/css/ link href=?php echo DT_PATH; ?file/select/skins/style.css rel=stylesh

文件下载:

华为网盘下载:http://dl.dbank.com/c0pvz9djzx

<!--下拉框开始-->
<link href="<?php echo DT_PATH; ?>file/select/reset.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo DT_PATH; ?>file/select/skins/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?php echo DT_PATH; ?>file/select/js/select_split.js"></script>

<!--下拉框结束-->


html代码:

<select 
onchange="changeTag();" 
id="bus_big_classid" 
name="bus_big_classid"
childId="bus_small_classid" 
childDataType="url" childDataPath='<?php echo DT_PATH; ?>project/project_function.php?act=pro_bus_small_items&id='>
                              <option value="-1">请选择一级行业分类</option>
                              <?php
                              foreach($bigclasslist as $arr1){
                              ?>
                              <option value='<?php  echo $arr1["bid"]; ?>'><?php echo $arr1["bname"]; ?></option>
                              <?php
                              }
                              ?>
                            </select>
                            
                             <select name="bus_small_classid" id="bus_small_classid">
                              <option value="">请选择二级行业分类</option>
                            </select>
                            <i id="bus_big_classid_msg" class="reg-msg"></i>

php代码:

$id = intval($id);
    $xml_data = "<?xml version='1.0' encoding='UTF-8'?>";
    $xml_data .= "<root>";
    if ($id>0) {
        $selectSql = "select bus_small_classid,bus_small_name from " . $CFG['tb_pre'] . "bus_small where bus_big_classid=" . $id;
        $resultSmall = $db->query($selectSql);
        while ($row = $db->fetch_array($resultSmall)) {
            $xml_data .="<node value='" . $row["bus_small_classid"] . "' text='" . $row["bus_small_name"] . "'/>";
        }
    } else {
        $xml_data .="<node value='' text='请选择二级行业分类'/>";
    }
    $xml_data .="</root>";
    echo $xml_data;

读取url 在ie下获取不到值。只能用xml

<select name="ach_inn_big_classid" id="ach_inn_big_classid"  childId="ach_inn_small_classid" childDataType="xml" childDataPath='<?php echo DT_PATH; ?>file/data/xml/ach_inn/'>
                            <option value="-1">请选择</option>
                            <?php foreach($ach_inn_big_lists as $arr){ ?>
                            <option value="<?php echo $arr['id']; ?>"><?php echo $arr["name"]; ?></option>
                            <?php } ?>
                          </select>
                          
                          <select name="ach_inn_small_classid" id="ach_inn_small_classid">
                            <option value="">请选择</option>
                          </select>



精彩图集

赞助商链接