...
|
...
|
@@ -9,12 +9,18 @@ |
|
|
<form class="js-ajax-form" method="post" action="{:url('School/school_edit_post')}" role="form" style="margin-top: 20px;">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon">学校地区:</span>
|
|
|
<select class="form-control">
|
|
|
<select class="form-control" name="province" id="province" required>
|
|
|
<option>请选择</option>
|
|
|
<foreach name="$province" item="p">
|
|
|
<option value="{$p.name}">{$p.name}</option>
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<input type="text" class="form-control" name="region" value="{$data.region}" >
|
|
|
<select class="form-control" name="city" id="city" required>
|
|
|
<option>请选择</option>
|
|
|
</select>
|
|
|
<select class="form-control" name="county" id="county" required>
|
|
|
<option>请选择</option>
|
|
|
</select>
|
|
|
<input type="text" class="form-control" name="region" value="{$data.region}" >
|
|
|
</div>
|
|
|
<br>
|
...
|
...
|
@@ -40,4 +46,50 @@ |
|
|
</div>
|
|
|
</body>
|
|
|
<script src="__STATIC__/js/admin.js"></script>
|
|
|
<script>
|
|
|
$('#province').change(function(){
|
|
|
var province_id = $('#province option:selected').val();
|
|
|
$.ajax({
|
|
|
url:"{:url('getArea')}",
|
|
|
type:"GET",
|
|
|
data:{'pid':province_id},
|
|
|
success:function(data) {
|
|
|
var result = eval("(" + data + ")");
|
|
|
if(result.code==20000){
|
|
|
var mydata = "<option value=''>请选择</option>";
|
|
|
for (var i = 0; i < result.data.length; i++) {
|
|
|
var data = result.data[i];
|
|
|
mydata += '<option value="'+data.name+'">'+data.name+'</option>';
|
|
|
}
|
|
|
$('#city').html(mydata);
|
|
|
$('#county').html("<option value=''>请选择</option>");
|
|
|
}else if(result.code==40005){
|
|
|
alert('获取失败!');
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
//获取区/县
|
|
|
$('#city').change(function(){
|
|
|
var city_id = $('#city option:selected').val();
|
|
|
$.ajax({
|
|
|
url:"{:url('getArea')}",
|
|
|
type:"GET",
|
|
|
data:{'pid':city_id},
|
|
|
success:function(data) {
|
|
|
var result = eval("(" + data + ")");
|
|
|
if(result.code==20000){
|
|
|
var mydata = "<option value=''>请选择</option>";
|
|
|
for (var i = 0; i < result.data.length; i++) {
|
|
|
var data = result.data[i];
|
|
|
mydata += '<option value="'+data.name+'">'+data.name+'</option>';
|
|
|
}
|
|
|
$('#county').html(mydata);
|
|
|
}else if(result.code==40005){
|
|
|
alert('获取失败!');
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
</script>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|