Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.4 kB
1
Indexable
Never
$(document).ready(function () {
    $("textarea").keyup(function () {
        let textarea = $("#comment").val().length;
        let remined = 100 - textarea;
        console.log(remined);
        $("#textarea").text(remined)
        if (remined < 1) {
            $('#textarea').css("color", "red");
        } else {
            $('#textarea').css("color", "green");
        }
    });

    var flag = false
    $('#checkbox').on('click', function () {
        if (!flag) {
            $('#submit').removeAttr('disabled');
            flag = true;
        } else {
            $("#submit").attr('disabled', '');
            flag = false;
        }
    });

    var firstname = '';
    var lastname = '';
    var mobile = '';

    $('#fname').keyup(function () {
        firstname = $("#fname").val();
        function Check(firstname, lastname, mobile)
    });

    $('#lname').keyup(function () {
        lastname = $("#lname").val();
        function Check(firstname, lastname, mobile)
    });

    $('#mobile').keyup(function () {
        mobile = $("#mobile").val();
        function Check(firstname, lastname, mobile)
    });

    function Check(firstname, lastname, mobile) {
        $('#live').append(
            +'i am sure that i want to add mr/mrs' + firstname + ' ' + lastname + 'whitnumber' + mobile
        )
    };

});