<?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 Re: How to hide email element in support form which was embedded into my website. in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261803#M23374</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/90095"&gt;@msrinivaskumar&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once the form HTML renders in the DOM, you can use any of several classes and IDs to hide the&amp;nbsp;&lt;CODE&gt;email&lt;/CODE&gt; form field or its parent elements. I targeted the class&amp;nbsp;&lt;CODE&gt;hs-email&lt;/CODE&gt;. (I did not attempt to hide the field with code within the embed script.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same&amp;nbsp;&lt;CODE&gt;onFormReady&lt;/CODE&gt; code works for me. The only difference I see is that you do not include a &lt;CODE&gt;;&lt;/CODE&gt; after &lt;CODE&gt;.change()&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your form rendering but simply not populating the default value? Can you share a link to a sample page in your HubSpot account testing the code on this form?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2019 21:07:04 GMT</pubDate>
    <dc:creator>IsaacTakushi</dc:creator>
    <dc:date>2019-03-27T21:07:04Z</dc:date>
    <item>
      <title>How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/260613#M23279</link>
      <description>&lt;P&gt;How to hide email element in support form which was embedded into my website, and assign value from logged-in user email adderes to email field while document load using jqyery or java script&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:09:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/260613#M23279</guid>
      <dc:creator>msrinivaskumar</dc:creator>
      <dc:date>2019-03-21T19:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261218#M23317</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/90095"&gt;@msrinivaskumar&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can hide the &lt;CODE&gt;email&lt;/CODE&gt;&amp;nbsp;form field with CSS alone by selecting it and applying&amp;nbsp;&lt;CODE&gt;display: none&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can fill the field with the user's email address a number of ways:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Append the value in an&amp;nbsp;&lt;CODE&gt;email&lt;/CODE&gt; query parameter in the URL. See &lt;A href="https://knowledge.hubspot.com/articles/kcs_article/forms/can-i-auto-populate-form-fields-through-a-query-string" target="_self"&gt;this article&lt;/A&gt; for more information.&lt;/LI&gt;
&lt;LI&gt;Pass the user's email to the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor" target="_self"&gt;&lt;CODE&gt;identify&lt;/CODE&gt; function&lt;/A&gt; and trigger a &lt;A href="https://developers.hubspot.com/docs/methods/tracking_code_api/track_page_view" target="_self"&gt;page view&lt;/A&gt;&amp;nbsp;before the form loads. This will pass the user's email into their&amp;nbsp;&lt;CODE&gt;hubspotutk&lt;/CODE&gt; cookie and HubSpot forms will detect this address.&lt;/LI&gt;
&lt;LI&gt;Set the form's &lt;CODE&gt;email&lt;/CODE&gt; field using jQuery and a variable. See &lt;A href="https://developers.hubspot.com/manipulating-forms-with-jquery" target="_self"&gt;this article&lt;/A&gt;&amp;nbsp;and &lt;A href="https://developers.hubspot.com/docs/methods/forms/advanced_form_options" target="_self"&gt;this article&lt;/A&gt;.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 25 Mar 2019 18:22:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261218#M23317</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-03-25T18:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261484#M23343</link>
      <description>&lt;P&gt;Hi Isaac,&lt;/P&gt;&lt;P&gt;I could not able to find the email id field to apply CSS or apply some default value on form ready . I am using below code snippet:&lt;/P&gt;&lt;P&gt;hbspt.forms.create(&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;portalId: 'XXXXXX',&lt;/P&gt;&lt;P&gt;formId: 'aa8b5b4a-62ac-461b-a387-XXXXXXXXXXX',&lt;/P&gt;&lt;P&gt;onFormReady: function($form, ctx){ $('input[name="email"]').val('Brian@gmail.com').change()&lt;BR /&gt;} });&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 16:26:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261484#M23343</guid>
      <dc:creator>msrinivaskumar</dc:creator>
      <dc:date>2019-03-26T16:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261803#M23374</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/90095"&gt;@msrinivaskumar&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once the form HTML renders in the DOM, you can use any of several classes and IDs to hide the&amp;nbsp;&lt;CODE&gt;email&lt;/CODE&gt; form field or its parent elements. I targeted the class&amp;nbsp;&lt;CODE&gt;hs-email&lt;/CODE&gt;. (I did not attempt to hide the field with code within the embed script.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same&amp;nbsp;&lt;CODE&gt;onFormReady&lt;/CODE&gt; code works for me. The only difference I see is that you do not include a &lt;CODE&gt;;&lt;/CODE&gt; after &lt;CODE&gt;.change()&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your form rendering but simply not populating the default value? Can you share a link to a sample page in your HubSpot account testing the code on this form?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 21:07:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/261803#M23374</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-03-27T21:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/263332#M23522</link>
      <description>&lt;P&gt;Thank you Isaac.&lt;/P&gt;&lt;P&gt;I resolved this issue&amp;nbsp;using below code snippet:&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;$(window).load(function(){&lt;/P&gt;&lt;P&gt;var iframe = $('iframe.hs-form-iframe')[0];&lt;BR /&gt;while (iframe.contentDocument.readyState == "complete"){&lt;BR /&gt;$('input[name="email"]', $('iframe').contents()).focus();&lt;BR /&gt;$('input[name="email"]', $('iframe').contents()).val('{{xxxxxx.Email}}').change();&lt;BR /&gt;//$('input[name="email"]', $('iframe').contents()).attr('readonly',true).change();&lt;BR /&gt;$('.hs_email', $('iframe').contents()).hide();&lt;BR /&gt;var $head = $("iframe").contents().find("head");&lt;BR /&gt;$head.append($("&amp;lt;link/&amp;gt;", { rel: "stylesheet", href: "css-xxxxx.css", type: "text/css" }));&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will hold email value on form load and hide emaild. And set the focus on email filed , reason is on keydown they applyign some validation . If ,not set focus on email field and trying to enter next field it casues to loose the value in email field (onblur validation will not happen and email id value will not persist) , it will fire required field validation on email. And then applied css to iframe head to override hubspot styles with my portal styles and branding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope , it will be useful to other developers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 20:43:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/263332#M23522</guid>
      <dc:creator>msrinivaskumar</dc:creator>
      <dc:date>2019-04-04T20:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide email element in support form which was embedded into my website.</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/263334#M23523</link>
      <description>&lt;P&gt;Thanks for sharing,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/90095"&gt;@msrinivaskumar&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 19:23:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-hide-email-element-in-support-form-which-was-embedded/m-p/263334#M23523</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-04-04T19:23:26Z</dc:date>
    </item>
  </channel>
</rss>

