<?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: Limit Character Count for Form Field in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226099#M4995</link>
    <description>&lt;P&gt;Trying to set a character limit on a text field to 250 characters, but its not working. The form just submits no matter what without checking the character limitation. Any help with getting this working would be awesome.&lt;/P&gt;
&lt;P&gt;Is the name= the id of the form field or something else?&lt;/P&gt;
&lt;P&gt;hbspt.forms.create({&lt;BR /&gt;
portalId: "XXXXX",&lt;BR /&gt;
formId: "XXXXXXXXXXXX",&lt;BR /&gt;
css: "",&lt;BR /&gt;
onFormReady: function($form) {&lt;BR /&gt;
$('input[name="closed_lost_notes"]').attr('minlength','250').change();&lt;BR /&gt;
$('input[name="closed_lost_notes"]').attr('maxlength','2500').change();&lt;BR /&gt;
},&lt;BR /&gt;
});&lt;/P&gt;
&lt;P&gt;Also is there a way to show the character count and custom validation message if submitted before reaching the 250 character limit?&lt;/P&gt;
&lt;P&gt;Thanks so much for any help!&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 22:41:59 GMT</pubDate>
    <dc:creator>Trevor_Hatfield</dc:creator>
    <dc:date>2018-08-03T22:41:59Z</dc:date>
    <item>
      <title>Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226096#M4992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a form for which I have to make one of the fields allow a limited amount of characters to be input (minimum 2, maximum 12).&lt;/P&gt;
&lt;P&gt;I found a solution mentioned in a different topic, which I tried to use, however, when I insert the actual code (the onformready), the form does not load anymore. Any possible way how I could approach this?&lt;/P&gt;
&lt;P&gt;hbspt.forms.create({&lt;BR /&gt;
portalId: "XXX",&lt;BR /&gt;
formId: "XXXXXXX",&lt;BR /&gt;
css: "",&lt;BR /&gt;
onFormReady: function($form) {&lt;BR /&gt;
$(“input[name="vat_number"]”).attr(‘maxlength’,‘12’);&lt;BR /&gt;
$(“input[name="vat_number"]”).attr(‘minlength’,‘2’);&lt;BR /&gt;
} ,&lt;BR /&gt;
});&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 06:23:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226096#M4992</guid>
      <dc:creator>PaulsPerkons</dc:creator>
      <dc:date>2018-03-26T06:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226097#M4993</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/paulsperkons"&gt;@paulsperkons&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;You'll want to chain &lt;CODE&gt;.change()&lt;/CODE&gt; to the end of each call, and also replace the left and right double quotes with standard double quotes (i.e. " )&lt;/P&gt;
&lt;ASIDE class="onebox whitelistedgeneric"&gt;
  &lt;HEADER class="source"&gt;
      &lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/original/1X/46c7134e5c588b9723986216fcb862e4f64d25e8.png" class="site-icon" width="16" height="16" /&gt;
      &lt;A href="https://developers.hubspot.com/docs/methods/forms/advanced_form_options" target="_blank" rel="nofollow noopener"&gt;developers.hubspot.com&lt;/A&gt;
  &lt;/HEADER&gt;
  &lt;ARTICLE class="onebox-body"&gt;
    

&lt;H3&gt;&lt;A href="https://developers.hubspot.com/docs/methods/forms/advanced_form_options" target="_blank" rel="nofollow noopener"&gt;How to customize the form embed code&lt;/A&gt;&lt;/H3&gt;

&lt;P&gt;This is a list of options that you can use if you just need to tweak a default hubspot form. If you need complete control over the styles and actions of your form, you will still want to use the Forms API.&lt;/P&gt;


  &lt;/ARTICLE&gt;
  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;
  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;
&lt;/ASIDE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 17:54:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226097#M4993</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-03-27T17:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226098#M4994</link>
      <description>&lt;P&gt;Thank you. This fixed it.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 07:53:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226098#M4994</guid>
      <dc:creator>PaulsPerkons</dc:creator>
      <dc:date>2018-03-28T07:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226099#M4995</link>
      <description>&lt;P&gt;Trying to set a character limit on a text field to 250 characters, but its not working. The form just submits no matter what without checking the character limitation. Any help with getting this working would be awesome.&lt;/P&gt;
&lt;P&gt;Is the name= the id of the form field or something else?&lt;/P&gt;
&lt;P&gt;hbspt.forms.create({&lt;BR /&gt;
portalId: "XXXXX",&lt;BR /&gt;
formId: "XXXXXXXXXXXX",&lt;BR /&gt;
css: "",&lt;BR /&gt;
onFormReady: function($form) {&lt;BR /&gt;
$('input[name="closed_lost_notes"]').attr('minlength','250').change();&lt;BR /&gt;
$('input[name="closed_lost_notes"]').attr('maxlength','2500').change();&lt;BR /&gt;
},&lt;BR /&gt;
});&lt;/P&gt;
&lt;P&gt;Also is there a way to show the character count and custom validation message if submitted before reaching the 250 character limit?&lt;/P&gt;
&lt;P&gt;Thanks so much for any help!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 22:41:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226099#M4995</guid>
      <dc:creator>Trevor_Hatfield</dc:creator>
      <dc:date>2018-08-03T22:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226100#M4996</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/trevor_hatfield"&gt;@Trevor_Hatfield&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;name&lt;/CODE&gt; is the input's &lt;CODE&gt;name&lt;/CODE&gt; attribute, which for HubSpot forms is the internal property name of the corresponding contact property. I'm not entirely sure why your code isn't working; can you give me a link to the page you're working on?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:54:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/226100#M4996</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-08-09T16:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Character Count for Form Field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/686347#M56379</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I figured it out this way:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;hbspt.forms.create({
        portalId: "123456",
        formId: "abcd-efg-hijk=lmno",
        onFormReady: function($form) {
          $form.find('textarea[name="message"]').attr('maxlength','150');
          $form.find('input[name="what_are_you_planning"]').attr('maxlength','150');
        },
  });&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Aug 2022 14:29:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Limit-Character-Count-for-Form-Field/m-p/686347#M56379</guid>
      <dc:creator>WTariq</dc:creator>
      <dc:date>2022-08-29T14:29:45Z</dc:date>
    </item>
  </channel>
</rss>

