Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda