How can i check Minimum amount should be less than maximum amount at jquery ?

Posted 11 months ago by HopesAreMiracle

Hello all , I need to check minimum amount is less than maximum amount from minimum input text and maximum input text in the jquery? How can i check ? Here is the method i check. Thanks.

$minimum_amt = $("#min_amt");
$maximum_amt = $("#max_amt");

$minimum_amt.on("change", function () {
    if ($minimum_amt.val() == '.') {
        alert("You can input only numeric number !");
    }
    if ($minimum_amt.val() > $maximum_amt.val()) {

        $(':input[name="submitDiscount"]').prop('disabled', true);
    }
    else {



        $(':input[name="submitDiscount"]').prop('disabled', false);

    }
});

$maximum_amt.on("change", function () {
    if ($maximum_amt.val() == '.') {
        alert("You can input only numeric number !");
    }
    if ($minimum_amt.val() > $maximum_amt.val()) {
        alert("Minimum Amount should be less than Maximum Amount !");
        $(':input[name="submitDiscount"]').prop('disabled', true);
    }
    else {



        $(':input[name="submitDiscount"]').prop('disabled', false);

    }
});

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.