Skip to content Skip to sidebar Skip to footer

Setting Input Validation Range Dynamically In Jquery

Thank you in advance for looking at this. :-) The form validation itself works on other items where the field is simply required - that is no problem. I am trying to set a numeri

Solution 1:

I found out (after reading the docs further on the validation plugin) that there is a .rules add method. So the .select can call this function:

function setvalidation(amountLocation,minimum){
    amountLocation.rules("add",{
                  required: true,
                  range: [minimum, 5000000],
                  messages: {
                      range: "$ "+minimum + " Minimum"
                 }                             
    }); 
}

Post a Comment for "Setting Input Validation Range Dynamically In Jquery"