/*************************************************注册用户证件号 复选框 combox循环赋值**********************************/
function certTypeSelect(certType) {
    var typeStr = '';
    var certTypes = '{"0":"身份证","1":"户口簿","2":"护照","3":"军官证","4":"士兵证","5":"港澳居民来往内地通行证","6":"台湾同胞来往内地通行证","7":"临时身份证","8":"外国人居留证","9":"警官证","X":"其他证件"}';
    eval("certTypess = "+certTypes);
    $.each(certTypess, function(index, temp) {
        if (certType == null && index == 0) {
            certType = index;
        }
        if (index == certType) {
            typeStr += '<option value=' + index + 'selected="selected">'
                    + temp + '</option>';
            
            $('#certType').combobox('setValue', certType);
        } else {
            typeStr += '<option value=' + index + '>' + temp
                    + '</option>';
        }
    });

    $('#certType').html(typeStr);
}

 

 

效果图:

JS中eval函数的使用

 

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-09-11
  • 2021-05-29
  • 2022-03-01
  • 2022-12-23
猜你喜欢
  • 2021-10-04
  • 2022-12-23
  • 2022-01-14
  • 2021-10-09
  • 2022-02-18
相关资源
相似解决方案