easyui-textbox添加事件

<input class="easyui-textbox" type="text" style="width: 100%"  required="true" validType="numrange([0,999])"  name="height"  id="height" />

<script>


    $(function() {
        function getWeightRatioHeight() {
            var height=$("#height").textbox('getValue');
            var weight=$("#weight").textbox('getValue');
            if(height==''){
                returnif(weight==''){
                return
            }
            var weightRatioHeight=weight/(height/100);
            $("#weight_height").textbox('setValue',weightRatioHeight.toFixed(2));
        }
        $('#height').textbox('textbox').bind('blur', function () {
            getWeightRatioHeight()
        });
       //为textbox添加onblur事件
    })
</script>

 

posted on 2017-10-12 10:02  三石为磊  阅读(2988)  评论(0编辑  收藏  举报

导航