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

  • $("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}>> 价格面议

转载于:https://www.cnblogs.com/shangguancn/p/5731763.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值