I have created a form using html and jquery. It is connected to a db and it should enter in the db the values which are written in the textboxes. But I have the following problem. If a specific textbox has no value typed, it should alert, and prevent datae from entering to db. It goes well. But as well, I want to have a textbox, and if the value of this textbox does not equal to the sum of the others, it should alert, and do the same with db. And there is the problem. It is not getting the right sum. I mean, if i have in the first textbox the value 15, and then in the others textboxes, value 10, and then, value 5.. (10+5 equals with the first textbox) it should not alert, and do what it requires to enter in the db this datae. But it doesn't. It alerts and so on. How can I get this sum right from a textbox to another? Thanks

```
function checkForm() {
    if ($('#nr_articol').val().length === 0) {
        alert("Nr articol trebuie sa fie introdus! ");
        return false;
    }
    return true;
}

function checkForm2() {
    if ($("#scurt_smd").val() + $("#incomplete_smd").val() + $("#bile").val() + $("#scurt_val").val() + $("#incomplete_val").val() + $("#lipsa_smd").val() + $("#invers_smd").val() + $("#componente_lipsa").val() + $("#componente_inversate_1").val() + $("#lipire_hotbar").val() + $("#componente_inversate_2").val() + $("#componente_inversate_3").val() + $("#componente_inversate_4").val() != $('#optic').val() || $('#electric').val()) {
        alert("Ai introdus mai multe sau mai putine bucati decat ai verificat in total. Verifica inca odata!");
        return false;
    }
    return true;
}

$(document).ready(function () {
    $('#submitbtn').click(function () {
        if (checkForm() == true) {
            if (checkForm2() == true) {
                var frm = $('#form');
                // var data = JSON.stringify(frm.serializeArray());
                var data = frm.serializeArray();
                console.log(data);

                $.ajax({
                    type: 'post',
                    url: 'http://localhost:3000/',
                    contentType: 'application/json',
                    crossDomain: true,
                    data: JSON.stringify(data),
                    dataType: 'json',
                    success: function () {
                        alert('sucessfully inserted');
                    },
                    error: function (err) {
                        console.log(err);
                    }

                });
            }
        }
    });
});

```