单选和输入框,点击单选按钮高亮文本框

  • $("input:radio[name='p_pricetype']").click(function(){
            var val=$('input:radio[name="p_pricetype"]:checked').val();
            if(val==1){
                $("input[name='p_spot']").removeAttr("disabled");
                $("input[name='p_spot']").focus();
                $("input[name='p_spot']").blur(function(){
                    var p_spot = $("input[name='p_spot']").val();
                    if(p_spot!=null){
                        if(Number(p_spot)<0&&(!isNaN(p_spot))){
                            alert('对不起,下浮点数应该大于0!');
                        }
                        if(isNaN(p_spot)){
                            alert('请输入数字。');
                        }
                    }
                });
            }
            if(val==2){
                $("input[name='reduceprice']").removeAttr("disabled");
                $("input[name='reduceprice']").focus();
                $("input[name='reduceprice']").blur(function(){
                    var reduceprice = $("input[name='reduceprice']").val();
                    if(reduceprice!=null){
                        if(Number(reduceprice)<0&&(!isNaN(reduceprice))){
                            alert('对不起,优惠金额应该大于0!');
                        }
                        if(isNaN(reduceprice)){
                            alert('请输入数字。');
                        }
                    }
                });
            }
            if(val==3){
                $("input[name='addprice']").removeAttr("disabled");
                $("input[name='addprice']").focus();
            }
            /*if(val==4){
                alert('111')
                //$("input[name='zhiprice']").removeAttr("disabled");
                $("input[name='zhiprice']").focus();
            }*/
            if(val==5){
                $("input[name='p_upspot']").removeAttr("disabled");
                $("input[name='p_upspot']").focus();
            }
        });

     

    checked<{elseif $cars.p_pricetype==4}>disabled<{/if}>> 上浮点数   value='<{$cars.p_spot}>'<{elseif $cars.p_pricetype==4 || !$cars.p_pricetype}>disabled<{/if}>> 点数
  • checked<{elseif $cars.p_pricetype==4}>disabled<{/if}>> 下浮点数   value='<{$cars.p_spot}>'<{elseif $cars.p_pricetype==4 || !$cars.p_pricetype}>disabled<{/if}>> 点数
  • checked<{elseif $cars.p_pricetype==4}>disabled<{/if}>> 优惠金额   value='<{$cars.reduceprice}>'<{elseif $cars.p_pricetype==4 || !$cars.p_pricetype}>disabled<{/if}>> 万元
  • checked<{elseif $cars.p_pricetype==4}>disabled<{/if}>> 加价金额   value='<{$cars.addprice}>'<{elseif $cars.p_pricetype==4 || !$cars.p_pricetype}>disabled<{/if}> size="10"> 万元
  • checked<{/if}>> 直接报价    万元
  • checked<{elseif $cars.p_pricetype==4}>disabled<{/if}>> 价格面议
posted @ 2016-08-03 10:15  上官靖宇  阅读(1088)  评论(0编辑  收藏  举报