当条件不满足使用Jquery时,如何获得警报窗口

时间:2015-09-23 07:40:50

标签: javascript jquery

在这里,我想解释一下我的问题,

我有下拉电话200000,在这里我习惯得到approved_amount这样的金额。 我有另一个实地电话suminsured_amount。现在我需要的是当我输入一个大于alert window的批准金额时,它会自动填充suminsured_amount你超过$(document).ready(function(){ var approved_amount = parseInt($("#importclaims-approved_amount").val(); var suminsured_amount = parseInt($("#importclaims-suminsured_amount").val(); if (approved_amount > suminsured_amount) { alert('exceeded'); } }); ,帮我解决这个问题 image1

剧本:

    private static byte[] deobfuscate_string(XORShift128 pnr, byte[] obfuscated)
    {
        byte[] deobfuscated = new byte[obfuscated.Length];

        for (int i = 0; i < obfuscated.Length; i++)
        {
            byte b = Convert.ToByte((obfuscated[i] - pnr.next()) & 0xff);
            deobfuscated[i] = b;
        }

        Array.Reverse(deobfuscated);
        return deobfuscated;
    }

    private class XORShift128
    {
        private UInt32 x = 123456789;
        private UInt32 y = 362436069;
        private UInt32 z = 521288629;
        private UInt32 w = 88675123;

        public XORShift128(UInt32 x, UInt32 y)
        {
            this.x = x;
            this.y = y;
        }

        public UInt32 next()
        {
            UInt32 t = (x ^ (x << 11)) & 0xffffffff;
            x = y;
            y = z;
            z = w;
            w = (w ^ (w >> 19) ^ (t ^ (t >> 8)));
            return w;
        }
    }

1 个答案:

答案 0 :(得分:0)

使用keydown事件:

//A function is triggered when the user is pressing a key in the input field.
$("#importclaims-suminsured_amount").on('keydown', function(){
    var suminsured_amount = parseInt($("#importclaims-suminsured_amount").val());
    var approved_amount = parseInt($("#importclaims-approved_amount").val());
    //Condition to alert
    if(suminsured_amount > approved_amount ){
        alert("Exceed the suminsured_amount");
    }

});