jQuery validate less than

后端 未结 5 1787
盖世英雄少女心
盖世英雄少女心 2020-12-15 12:05

I am trying to write a Less than validator for jQuery.

I want to compare one text box against another, so if I have:



        
5条回答
  •  执笔经年
    2020-12-15 12:38

    Consider (A) is the name of the input that you want the value of it to be less than (#B) input. this code worked with me after making the type of the two inputs is: type="number"

    $("#form").validate({
        rules: {
            A: {
                lessThan: "#B"
            }
        }
    });
    

提交回复
热议问题