级联查询

html

 <select id="word" "selectWord()">
                            <option>>----请选择----</option>
                            <option name="apply[content]" value="技术资料">技术资料</option>
                            <option name="apply[content]" value="知识产权证书">知识产权证书</option>
                        </select>
                        <select id="doc">
                            <option>----请选择----</option>
                        </select>

js

function selectDoc(goods_id){
        /*new Request.JSON({
            url:'<{link app=business ctl=site_apply act=select_doc}>',
            method:'post',
            async:true,
            data:{
                "goods_id":goods_id,
                "goods_name":goods_name
            },
            onComplete:function(res,text){
                if (res.success=="false"){
                    Message.error(res.data);
                }else{
                    alert($document_list);
                    location.href=res.reload;
                }
            }
        }).send();
        return false;*/
         var document_names = '<{$document_name}>';
         var document_goods_ids = '<{$document_goods_id}>';
         option = '';
         if(document_names){
             var document_name =document_names.split(',');
             var document_goods_id =document_goods_ids.split(',');
             for(var i=0;i<document_name.length;i++){
                 if(document_goods_id[i] == goods_id){
                     option += '<option name="apply[doc]" value=document_goods_id[i]>'+document_name[i]+'</option>';
                 }
             }
             if(option==''){
                 option = '<option selected>该产品没有技术资料</option>';
             }
         }
        var property_names = '<{$property_name}>';
        var property_goods_ids = '<{$property_goods_id}>';
        option1 = '';
        if(property_names){
            var property_name =property_names.split(',');
            var property_goods_id =property_goods_ids.split(',');
            for(var i=0;i<property_name.length;i++){
                if(document_goods_id[i] == goods_id){
                    option1 += '<option name="apply[doc]" value=property_goods_id[i]>'+property_name[i]+'</option>';
                }
            }
            if(option1==''){
                option1 = '<option selected>该产品没有知识产权证书</option>';
            }
        }
        if(option == '' && option1 == ''){
            alert("该产品不能进行产品申请,请重新选择产品");
            location.href='';
        }
        selectWord();
    }
    function selectWord(){
        var word = $("word").options[$("word").selectedIndex].value;
        if(word == '技术资料'){
            $("doc").set('html', option);
        }else if(word == '知识产权证书'){
            $("doc").set('html', option1);
        }
    }
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值