JavaScript jQuery Error: Maximum call stack size exceeded

Last Reply 3 months ago By dharmendr

Posted 3 months ago

i use below  code and got the maximum call stack size exceeded error.

    $('#Formitemdetails .used_in_formula').bind('input change', function () {        
        var changefield = $(this).attr('name');
        var formula_field_value = $(this).val();
        $('#Formitemdetails .formula_field').each(function () {
            if (changefield.toLowerCase() != $(this).attr('name').toLowerCase()) {
                var acualformula = $(this).attr('formula').toLowerCase();
                acualformula = acualformula.replace("=", "");

                var formulavalue;
                $('#Formitemdetails .used_in_formula').each(function () {
                    if ($(this).val() == '') {
                        acualformula = acualformula.replaceAll($(this).attr('name').toLowerCase(), "0");
                    }
                    else {
                        acualformula = acualformula.replaceAll($(this).attr('name').toLowerCase(), $(this).val());
                    }

                    if (acualformula != undefined) {
                        formulavalue = acualformula;
                        //$(this).value= eval(acualformula).toFixed(2);
                    }
                })
                formulavalue = formulavalue.replaceAll("parsefloat", "parseFloat");
                formulavalue = formulavalue.replaceAll("tofixed", "toFixed");
                if (eval(formulavalue) != undefined) {
                    //document.getElementById($(this).attr('id')).value = eval(formulavalue).toFixed(2);
                    $("#" + $(this).attr('id')).val(eval(formulavalue)).change();
                }
            }
        });
    });
You are viewing reply posted by: dharmendr 3 months ago.
Posted 3 months ago