title: HubSpot Embedded Form - Move labels below the inputs breaking form
body: <p>I'm manipulating the DOM with jquery in the HubSpot form embed code. I'm trying to move the labels below the inputs to achieve the CSS styles I need.</p>
  <pre><code>&lt;script&gt;
      hbspt.forms.create({
          portalId: &quot;xxxxx&quot;,
          formId: &quot;xxxx&quot;,
          cssClass: '',
          cssRequired: 'form__field required',
          errorClass: 'form__field',
          errorMessageClass: 'error',
          submitButtonClass: 'submitBTN',
          onFormReady: function ($form) {
              $('form').wrapInner('&lt;div class=&quot;form-row form_block&quot;&gt;&lt;/div&gt;')
              $('.hs-form-field').addClass('form-group col-md-12');
              $('input').addClass('form__field');
              $('label').addClass('form__label');
              $(&quot;.input input&quot;).each(function () {
                  var e = $(this);
                  e.parent().parent().find('label').insertAfter(e);
              })
          }
      });
  &lt;/script&gt;
  </code></pre>
  <p>However, I'm running into an issue. With an error that's not very helpful. When a field isn't valid, then trying to go back into the field to edit, I get the below JS error. One error for each letter I type.</p>
  <pre><code>v2.js:4 Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.
      at r (v2.js:4)
      at Object.processUpdates (v2.js:1)
      at Object.dangerouslyProcessChildrenUpdates [as processChildrenUpdates] (v2.js:2)
      at s (v2.js:3)
      at a.updateChildren (v2.js:3)
      at a._updateDOMChildren (v2.js:2)
      at a.updateComponent (v2.js:2)
      at a.receiveComponent (v2.js:2)
      at Object.receiveComponent (v2.js:3)
      at u._updateRenderedComponent (v2.js:2)
  </code></pre>
  <p>When I remove the label insertAfter() script those errors go away. I also posted in the HubSpot community, I will update answers each place.</p>
  <p><a href="https://community.hubspot.com/t5/APIs-Integrations/Move-labels-below-the-inputs-in-Embedded-Form/td-p/354385" rel="nofollow noreferrer">https://community.hubspot.com/t5/APIs-Integrations/Move-labels-below-the-inputs-in-Embedded-Form/td-p/354385</a></p>
  <p>Any help would be appreciated. Thanks!</p>