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

153
Visualizações
Mousedown is not triggering from a checkbox in modal popup to an outside popup button

The modal popup is a drupal dialogbox which is coming inside an iframe. I need to trigger mousedown on a submit button which is outside iframe when checkboxes are clicked in popup. I wrote the below jquery, but the button is not affecting.

$('#modal-popup .form-boolean--type-checkbox').click(() => {
   let body = $(window.parent.document.body);
   console.log(body);         
   body.find('[name="add_more_button"]').mousedown();
});

$(window.parent.document.body).find('[name="add_more_button"]').mousedown(); works in the console but not from jQuery. Why is this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I got the solution after hours of research. From iframe we can call a function of parent window. I used below code and working fine.

$('#modal-popup .form-boolean--type-checkbox').click(() => {
    window.parent.parentFunction();
 });

 window.parentFunction = function(){
   $('[name="add_more_button"]').mousedown();
 }

I used separate function for triggering the button and used window.FuntionName name for this. From iframe popup, I called this function to trigger mousedown using window.parent.FunctionName()

about 4 years ago · Juan Pablo Isaza Relatório
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