<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Stop information from being sent in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Stop-information-from-being-sent/m-p/858897#M67915</link>
    <description>&lt;P&gt;Hi! I'm trying to customize my form with some tweaks, and the last one I need to work is that, when the contact meets one of the three validation conditionals, the form needs to be stopped from sending the infos to hubspot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I already have is this one. I'm using wordpress + elementor combo, and the form show up as a popup when clicking on a button on the page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="formTarget"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;hbspt.forms.create({&lt;BR /&gt;region: "na1",&lt;BR /&gt;portalId: "39782198",&lt;BR /&gt;formId: "8ff9e15d-62da-428a-bc2f-ababa33907e7",&lt;BR /&gt;target: "#formTarget",&lt;BR /&gt;onFormReady: function(jQueryform) {&lt;BR /&gt;// Adicione um ouvinte de evento de envio do formulário&lt;BR /&gt;jQueryform[0].addEventListener("submit", function(event) {&lt;BR /&gt;var qualificacao = jQueryform.find('select[name="aposentado_ou_pensionista_"]').val();&lt;BR /&gt;var diagnostico = jQueryform.find('select[name="diagnostico"]').val();&lt;BR /&gt;var salarioBruto = jQueryform.find('select[name="salario_bruto_de_beneficio"]').val();&lt;/P&gt;&lt;P&gt;console.log(qualificacao);&lt;/P&gt;&lt;P&gt;if (qualificacao == "Nenhuma das opções" || diagnostico == "Outra Enfermidade" || salarioBruto != "Até R$3.500,00") {&lt;BR /&gt;// Impede o envio padrão do formulário&lt;BR /&gt;event.preventDefault();&lt;/P&gt;&lt;P&gt;// Desativa e oculta o botão de enviar&lt;BR /&gt;jQueryform.find('[type="submit"]').prop('disabled', true).hide();&lt;BR /&gt;&lt;BR /&gt;// Adiciona um botão de fechar&lt;BR /&gt;var closeButton = jQuery('&amp;lt;button class="fecha-janela"&amp;gt;Fechar&amp;lt;/button&amp;gt;');&lt;BR /&gt;closeButton.click(function() {&lt;BR /&gt;// Fecha a popup&lt;BR /&gt;jQuery('#elementor-popup-modal-466').hide();&lt;BR /&gt;});&lt;BR /&gt;jQueryform.append(closeButton);&lt;BR /&gt;&lt;BR /&gt;// Exibe um alerta personalizado&lt;BR /&gt;alert("Infelizmente você não cumpre os requisitos para receber o benefício.");&lt;BR /&gt;} else {&lt;BR /&gt;// Lead qualificado, redireciona para a página de obrigado&lt;BR /&gt;window.location.href = "&lt;A href="https://google.com" target="_blank" rel="noopener"&gt;https://google.com&lt;/A&gt;";&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2023 16:03:18 GMT</pubDate>
    <dc:creator>abiam</dc:creator>
    <dc:date>2023-10-03T16:03:18Z</dc:date>
    <item>
      <title>Stop information from being sent</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Stop-information-from-being-sent/m-p/858897#M67915</link>
      <description>&lt;P&gt;Hi! I'm trying to customize my form with some tweaks, and the last one I need to work is that, when the contact meets one of the three validation conditionals, the form needs to be stopped from sending the infos to hubspot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I already have is this one. I'm using wordpress + elementor combo, and the form show up as a popup when clicking on a button on the page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="formTarget"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;hbspt.forms.create({&lt;BR /&gt;region: "na1",&lt;BR /&gt;portalId: "39782198",&lt;BR /&gt;formId: "8ff9e15d-62da-428a-bc2f-ababa33907e7",&lt;BR /&gt;target: "#formTarget",&lt;BR /&gt;onFormReady: function(jQueryform) {&lt;BR /&gt;// Adicione um ouvinte de evento de envio do formulário&lt;BR /&gt;jQueryform[0].addEventListener("submit", function(event) {&lt;BR /&gt;var qualificacao = jQueryform.find('select[name="aposentado_ou_pensionista_"]').val();&lt;BR /&gt;var diagnostico = jQueryform.find('select[name="diagnostico"]').val();&lt;BR /&gt;var salarioBruto = jQueryform.find('select[name="salario_bruto_de_beneficio"]').val();&lt;/P&gt;&lt;P&gt;console.log(qualificacao);&lt;/P&gt;&lt;P&gt;if (qualificacao == "Nenhuma das opções" || diagnostico == "Outra Enfermidade" || salarioBruto != "Até R$3.500,00") {&lt;BR /&gt;// Impede o envio padrão do formulário&lt;BR /&gt;event.preventDefault();&lt;/P&gt;&lt;P&gt;// Desativa e oculta o botão de enviar&lt;BR /&gt;jQueryform.find('[type="submit"]').prop('disabled', true).hide();&lt;BR /&gt;&lt;BR /&gt;// Adiciona um botão de fechar&lt;BR /&gt;var closeButton = jQuery('&amp;lt;button class="fecha-janela"&amp;gt;Fechar&amp;lt;/button&amp;gt;');&lt;BR /&gt;closeButton.click(function() {&lt;BR /&gt;// Fecha a popup&lt;BR /&gt;jQuery('#elementor-popup-modal-466').hide();&lt;BR /&gt;});&lt;BR /&gt;jQueryform.append(closeButton);&lt;BR /&gt;&lt;BR /&gt;// Exibe um alerta personalizado&lt;BR /&gt;alert("Infelizmente você não cumpre os requisitos para receber o benefício.");&lt;BR /&gt;} else {&lt;BR /&gt;// Lead qualificado, redireciona para a página de obrigado&lt;BR /&gt;window.location.href = "&lt;A href="https://google.com" target="_blank" rel="noopener"&gt;https://google.com&lt;/A&gt;";&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 16:03:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Stop-information-from-being-sent/m-p/858897#M67915</guid>
      <dc:creator>abiam</dc:creator>
      <dc:date>2023-10-03T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Stop information from being sent</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Stop-information-from-being-sent/m-p/860307#M67990</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/641576"&gt;@abiam&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for the interesting question. Did you get any closer to finding the root issue?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, have you tried:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Have you tried using&amp;nbsp;&lt;CODE&gt;console.log()&lt;/CODE&gt;&lt;SPAN&gt; statements to print the values of &lt;/SPAN&gt;&lt;CODE&gt;qualificacao&lt;/CODE&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;CODE&gt;diagnostico&lt;/CODE&gt;&lt;SPAN&gt;, and &lt;/SPAN&gt;&lt;CODE&gt;salarioBruto&lt;/CODE&gt;? To verify the values checked are what you expect to see.&lt;BR /&gt;&lt;LI-CODE lang="javascript"&gt;console.log('Qualificação:', qualificacao);
console.log('Diagnóstico:', diagnostico);
console.log('Salário Bruto:', salarioBruto);
​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Have you tried wrapping&lt;SPAN&gt;&amp;nbsp;this inside a &lt;/SPAN&gt;&lt;CODE&gt;window.onload&lt;/CODE&gt;&lt;SPAN&gt; function or jQuery’s &lt;/SPAN&gt;&lt;CODE&gt;$(document).ready()&lt;/CODE&gt;&lt;SPAN&gt; function? To make sure everything is loaded before your script runs.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for the additional details! — Jaycee&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 17:07:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Stop-information-from-being-sent/m-p/860307#M67990</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-10-05T17:07:40Z</dc:date>
    </item>
  </channel>
</rss>

