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

201
Visualizações
How to get my LWC to listen to events from FormAssembly form?

I've got FormAssembly installed in my org and it's loading a form on an experience site (community). I'm trying to get my custom LWC on the site to listen to events coming from the form but nothing seems to work.

In my form script tags I'm firing a custom event:

<script>
  window.onload = function() {
  const message = 'testMessage';
  let event = new CustomEvent("formMessage", { detail: message });
  window.dispatchEvent(event);
  console.log('formMessage event fired');
};

</script>

and on my LWC I add the event listener in the connected callback function:

  connectedCallback() {
    window.addEventListener("formMessage", (event) => {
      console.log('formMessage event listener ' +event.detail)
    });
  }

Now I know the forms are embedded in an iFrame but I'm pretty sure I can listen to events coming from there. I've also made sure that the event is firing and that the listener is registered on my LWC before the form fires the event but I still get nothing on the other end.

Any idea what I'm missing?

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