<?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 How would you limit the number of choices in select element in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-would-you-limit-the-number-of-choices-in-select-element/m-p/386554#M19592</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a module but got stuck, I have a hubdb with a column of the type select and this column have 5 choices and I would like to have a select filter in my custom module but I would only wish to display 3 of those 5 choices. How would you go about doing that? Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Nov 2020 20:36:42 GMT</pubDate>
    <dc:creator>AminWejebe</dc:creator>
    <dc:date>2020-11-14T20:36:42Z</dc:date>
    <item>
      <title>How would you limit the number of choices in select element</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-would-you-limit-the-number-of-choices-in-select-element/m-p/386554#M19592</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm building a module but got stuck, I have a hubdb with a column of the type select and this column have 5 choices and I would like to have a select filter in my custom module but I would only wish to display 3 of those 5 choices. How would you go about doing that? Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 20:36:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-would-you-limit-the-number-of-choices-in-select-element/m-p/386554#M19592</guid>
      <dc:creator>AminWejebe</dc:creator>
      <dc:date>2020-11-14T20:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: How would you limit the number of choices in select element</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-would-you-limit-the-number-of-choices-in-select-element/m-p/386636#M19602</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/124871"&gt;@AminWejebe&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to display 3 specific choices, or any 3 (i.e. the first 3). If any will do, you could add an if statement in your for loop like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set choices = hubdb_table_column(table_id, "choices").options %}
&amp;lt;select id="myFilter"&amp;gt;
  &amp;lt;option selected="selected" value="all"&amp;gt;Choose an option&amp;lt;/option&amp;gt;
  {% for item in options %}
    {% if loop.index &amp;lt;= 3 %}
    &amp;lt;option value="{{item}}"&amp;gt;{{item}}&amp;lt;/option&amp;gt;
    {% endif %}
  {% endfor %}
&amp;lt;/select&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I could be more helpful if you copy/paste your code, as the above is assuming you're pulling the choices directly from the HubDB.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 09:52:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-would-you-limit-the-number-of-choices-in-select-element/m-p/386636#M19602</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-11-16T09:52:25Z</dc:date>
    </item>
  </channel>
</rss>

