Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
javascript handling confirm if user selects to not allow prompting

on my wordpress site i have a table with buttons in each row that make ajax calls. each button confirms with the user before taking any action. after clicking the button and confirming more than once there's a checkbox in the confirm window that the user can click to prevent the site from prompting them again to confirm.

enter image description here

when i select this check box the next button i click in the table doesn't work because i have some logic in my javascript that is checking if the confirmation was true or not. any ideas or techniques on how i can code around this? i would like for the user to confirm their choice at least once, but i'm ok with them selecting to not be prompted again.

            var confirmMessage='Press Ok to mark complete.';
            var x = confirm(confirmMessage); 
            if (x == true) {
                $.post(my_ajax_obj.ajax_url, {     //POST request
                    _ajax_nonce: my_ajax_obj.nonce, //nonce
                    action: "all_table_complete",        //action
                    row_result_id: trid              //data
                }, function(data) {                //callback
                    var retractTdSearchFor = "retract_button_" + trid;     
                    this2.closest('td').innerHTML = data;           //insert server response
                    document.getElementById(retractTdSearchFor).innerHTML = "Completed"; // should find ignore td with same result id
                });
            } // if (x == true)
            else
            {
                // the user did not click ok. 
            }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda