$.ajax({
type: "get",
url: "/xjzfw.enumtypelistjson.phtml",
data: {},
async: true,
success: function(data){
var jdatad=jQuery.parseJSON(data);
console.log(jdatad)
$.each(jdatad.rows,function(i,row){
console.log(row.enum_name)
//身份证
if("card_type"==row.enum_id){
$("#cardtype").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
//文化程度
if("education_level"==row.enum_id){
$("#level_education").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
//政治面貌
if("political_status"==row.enum_id){
$("#political_landscape").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
//婚姻状况
if("marry_state"==row.enum_id){
$("#marital_status").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
//职业
if("profession"==row.enum_id){
$("#vocation").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
//身份
if("persione_kind"==row.enum_id){
$("#kind").append('<option value="'+row.id+'" selected="selected">'+row.enum_name+'</option>');
}
});
}
});
数据字典动态生成下拉框
最新推荐文章于 2024-07-07 16:58:45 发布