[Skip to main content](#vessel-content)

#   HTML within a filter custom field does not work

##

- **[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")**
- [![dkmetz@taylorbruce.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile") Topic Author
- [ Offline](/forum/user/11254-dkmetz-taylorbruce-com)

Less More

- Posts: 69
- Thank you received: 1
-
-
-
-

11 years 4 months ago [\#205944](#205944) by [dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")  *[HTML within a filter custom field does not work](/forum/45-filters-search/877736-html-within-a-filter-custom-field-does-not-work#205944 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.25  Hi,  My filters are all working except for filters where I need to enter HTML code... here is my situation:  1. my records have been imported with a custom field called Temperature with values like 600oF 800oF etc.  2. this data is preserved in the export... and looks exactly like the above... so far so good  3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...  4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example: 600oF(6) 800oF(9) etc. These numbers look accurate.  My issue is that I cannot enter the above values into the custom field VALUES fields. This custom field is a radio button. When I enter 600oF the value changes to 600oF when I save the field... and of course the filter does not work.  How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?  Thanks,  Dennis")* was created by *[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.25

Hi,

My filters are all working except for filters where I need to enter HTML code... here is my situation:

1. my records have been imported with a custom field called Temperature with values like
600&lt;sup&gt;o&lt;/sup&gt;F
800&lt;sup&gt;o&lt;/sup&gt;F
etc.

2. this data is preserved in the export... and looks exactly like the above... so far so good

3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...

4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example:
600&lt;sup&gt;o&lt;/sup&gt;F(6)
800&lt;sup&gt;o&lt;/sup&gt;F(9)
etc.
These numbers look accurate.

My issue is that I cannot enter the above values into the custom field VALUES fields.
This custom field is a radio button. When I enter **600&lt;sup&gt;o&lt;/sup&gt;F** the value changes to **600oF** when I save the field... and of course the filter does not work.

How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?

Thanks,

Dennis

---

\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Dennis Kmetz

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzczNi1odG1sLXdpdGhpbi1hLWZpbHRlci1jdXN0b20tZmllbGQtZG9lcy1ub3Qtd29yaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")**
- [![dkmetz@taylorbruce.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile") Topic Author
- [ Offline](/forum/user/11254-dkmetz-taylorbruce-com)

Less More

- Posts: 69
- Thank you received: 1
-
-
-
-

11 years 4 months ago [\#205946](#205946) by [dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")  Replied by *[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")* on topic *[HTML within a filter custom field does not work](/forum/45-filters-search/877736-html-within-a-filter-custom-field-does-not-work#205946 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.25  Hi,  My filters are all working except for filters where I need to enter HTML code... here is my situation:  1. my records have been imported with a custom field called Temperature with values like 600oF 800oF etc.  2. this data is preserved in the export... and looks exactly like the above... so far so good  3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...  4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example: 600oF(6) 800oF(9) etc. These numbers look accurate.  My issue is that I cannot enter the above values into the custom field VALUES fields. This custom field is a radio button. When I enter 600oF the value changes to 600oF when I save the field... and of course the filter does not work.  How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?  Thanks,  Dennis")*

PS.

I tried entering the values with quotes... both single and double quotes. The quotes remain, but the text is change exactly like the above, for example "600&lt;sup&gt;o&lt;/sup&gt;F" changes to "600oF" when I save the field.

Dennis

---

\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Dennis Kmetz

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzczNi1odG1sLXdpdGhpbi1hLWZpbHRlci1jdXN0b20tZmllbGQtZG9lcy1ub3Qtd29yaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

11 years 4 months ago [\#205948](#205948) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[HTML within a filter custom field does not work](/forum/45-filters-search/877736-html-within-a-filter-custom-field-does-not-work#205948 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.25  Hi,  My filters are all working except for filters where I need to enter HTML code... here is my situation:  1. my records have been imported with a custom field called Temperature with values like 600oF 800oF etc.  2. this data is preserved in the export... and looks exactly like the above... so far so good  3. when displayed on a web page, the above looks proper... and upon inspection I can see the html code... good so far...  4. the radio button custom field PIE CHART that appears at the bottom of the custom field entry form has values that look valid... that is, the pie chart slices are accurate, and the data to the right of the PIE CHART for the custom field looks like the above... followed by the number of records for each... so it looks like this for example: 600oF(6) 800oF(9) etc. These numbers look accurate.  My issue is that I cannot enter the above values into the custom field VALUES fields. This custom field is a radio button. When I enter 600oF the value changes to 600oF when I save the field... and of course the filter does not work.  How do I enter HTML into the VALUES field of a radio button custom field to allow me to filter on this value?  Thanks,  Dennis")*

Hi,

Yes, that's normal. HTML is not allowed in custom field values.

Change the code: Code:

$field-&gt;field_value[] = strip_tags($title) . '::' . strip_tags($value) . '::' . strip_tags($disabled);

to: Code:

jimport('joomla.filter.filterinput'); $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $field-&gt;field_value[] = $safeHtmlFilter-&gt;clean($title,'string'). '::' . $safeHtmlFilter-&gt;clean($value,'string') . '::' . $safeHtmlFilter-&gt;clean($disabled,'string');

in the file administrator/components/com_hikashop/classes/field.php and that should allow HTML in values.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NzczNi1odG1sLXdpdGhpbi1hLWZpbHRlci1jdXN0b20tZmllbGQtZG9lcy1ub3Qtd29yaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
