实现二级关联

实现区县和街道二级关联
var qxj = document.getElementById('map_qyssqx');
getStandCodeTableResult('qxdm','011',qxj,1);
if('${map.qyssqx}'!=''){
document.getElementById('map_qyssqx').value='${map.qyssqx}';
}
$("#map_qyssqx").on('change',function() {
findJdByQx($(this).val());
})
  function findJdByQx(qxId){
var sys = document.getElementById('map_qyssjd');
getStandCodeTableResult("jddm",qxId, sys,1);
}
 
页面代码
<view:qrytr>
    <view:qrytd width="15%" heightshow="true">所属区县:</view:qrytd>
    <view:qrytd width="35%" >
     <select id="map_qyssqx" name="map.qyssqx"/>
       </view:qrytd>
    <view:qrytd width="15%" heightshow="true">所属街道:</view:qrytd>
    <view:qrytd width="35%" >
   <select id="map_qyssjd" name="map.qyssjd"/>
     </view:qrytd>
     </view:qrytr>

posted @ 2019-04-14 17:55  那些年的代码  阅读(187)  评论(0编辑  收藏  举报