省份、市区、县级 等区域调用
思路:用ajax调取区域数据ajax($parendid,ID) parendid 是父级I; 后面是需要给值“shiqu”,“quyu”
html代码
<select name="shengfen" id="shengfen" onchange="area(this.value,'shiqu')"> <option value="">请选择省份</option> {$vo['shengfen']} </select> <select name="shiqu" id="shiqu" onchange="area(this.value,'quyu')"> <option value="">请选择市</option> </select> <select name="quyu" id="quyu"> <option value="">请选择区域</option> </select>
js
function area(a,b){ $.ajax({ url:"{:U('Client/ajax_raea')}&parentid="+a, success:function(html){ //alert(html); $("#"+b+"").html(html); } }); }