Why is this function interpreting that you hear more than one click?

0

I have the following function.

function getValue() {
    $("#SavePaper").click(function(e) {
        if($(this).is(':checked')){
            if ( $("input[type='radio'][name='Licenciamentodeusuários']").is(':checked') ){
                valor = $('input:radio[name=Licenciamentodeusuários]:checked').val();

                if(valor == "Até") {

                    if ($("#Ate-Comercial-MF").val() != undefined) {
                        qtdUsuarios = $("#Até-Comercial-MF").val();
                        vlrSavePaper = qtdUsuarios * 0.99;
                        console.log(vlrSavePaper);
                    }
                    if ($("#Até-Educacional-MF").val() != undefined) {
                        qtdUsuarios = $("#Até-Educacional-MF").val();
                        vlrSavePaper = qtdUsuarios * 0.99;
                        console.log(vlrSavePaper);
                    }
                    if ($("#Até-Profissional-MF").val() != undefined) {
                        qtdUsuarios = $("#Até-Profissional-MF").val();
                        vlrSavePaper = qtdUsuarios * 0.99;
                        console.log(vlrSavePaper);
                    }

                    if ($("#Até-Comercial-NG").val() != undefined) {
                        qtdUsuarios = $("#Até-Comercial-NG").val();
                        vlrSavePaper = qtdUsuarios * 0.99;
                        console.log(vlrSavePaper);
                    }
                    if ($("#Até-Educacional-NG").val() != undefined) {
                        qtdUsuarios = $("#Até-Educacional-NG").val();
                        vlrSavePaper = qtdUsuarios * 0.20;
                        console.log(vlrSavePaper);
                    }
                    if ($("#Até-Profissional-NG").val() != undefined) {
                        qtdUsuarios = $("#Até-Profissional-NG").val();
                        vlrSavePaper = qtdUsuarios * 0.99;
                        console.log(vlrSavePaper);
                    }
                }else{
                    valor = valor.replace(/\s{2,}/g, ' ');
                    valor = valor.split(" ");

                    vlrSavePaper = valor[2] * 0.99;
                    console.log(vlrSavePaper);
                }
            }

         }
     });
}

This function is a call to an onclick () from a checkbox, and it seems like it is running as though it were multiple clicks, by my understanding of Chrome debugging.

This is the return in Chrome

With 1 click With2clicks With3clicks

    
asked by anonymous 18.08.2017 / 14:20

0 answers