一、调用citys里的3个js文件
二、页面调用
<script type="text/javascript" src="<?=$C->SITE_URL?>js/jquery-1.8.0.min.js"></script> <script src="<?=$C->SITE_URL?>js/jquery.doubleSelect.min.js"></script> <script src="<?=$C->SITE_URL?>js/citys.js"></script> <script src="<?=$C->SITE_URL?>js/Validform.js"></script> <script> $(document).ready(function () { $("#reg").Validform({ tiptype:2, ajaxPost:false }); var options = { <?php if (!empty($D->province_id) && !empty($D->city_id)) { ?> preselectFirst: <?=$D->province_id?>, preselectSecond: <?=$D->city_id?> <?php } ?> }; $('#province').doubleSelect('city', selectoptions, options); }); </script> <span class="InfoEdit"> <select name="province_id" id="province"> <option name="province_id" value=""> <?=empty($D->province_id) ? "--------" : $this->network->get_city_name_byid_p($D->province_id) ?> </option> </select> <select name="city_id" id="city"> <option name="city_id" value=""> <?=empty($D->city_id) ? "--------" : $this->network->get_city_name_byid_c($D->province_id, $D->city_id) ?> </option> </select> </span>