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

#   Assistance on a little HACK

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 5 months ago -  13 years 5 months ago [\#103775](#103775) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103775 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

As I found some limits in the filter philosophy I managed to build a little hack to create a "Clear all filter settings at once" button so for my 5 filter setup I don'thave to "kill" five times to go back to a global product list.

However something strange is happening and probably you can illuminate me:

I have a 5 filtter module, 4 are lists, 1 is text box.

If i create code to kill the four list filters at once it works no matter only one list filter was active.

If I create a button that kills 4 list filters plus text box it only works when the text box has something inside, lets say when the filter can be killed.

**This is the simple code I created for 4 list filter reseting button (and works always)**Code:

&lt;tr&gt;&lt;td&gt; &lt;span class="hikashop_filter_button_outside" style="float:right"&gt; &lt;a class="hikashop_cart_button_cancel" id="hikashop_filter_button_module_111" onclick="document.getElementById('filter_Mastil_module_111').value=''; document.getElementById('filter_Marca_module_111').value=''; document.getElementById('filter_Tipo_module_111').value=''; document.getElementById('filter_Carga_module_111').value=''; document.forms['hikashop_filter_form_module_111'].submit(); return false;" href="../../catalogo-de-carretillas" &gt;Anular búsqueda&lt;/a&gt;&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;

**And then if add this piece for 4 lists + text box reseting at once (it will only work when text box is not empty)**Code:

document.getElementById('filter_Buscar_por_texto_module_111').value='';

I think maybe a text box should be killed in a different way, this is the one I observed in the HTML code anyhow...

I can confirm the code has been working for weeks perfectly when I only had to kill the list filters and the limitation only started when I had to add the text box to the Reset button

UPDATE:

This problem is only happening in the main category which is displayed through a Menu. When entering subcategories the reseting works fine without the need to fill the text box.

Last edit: 13 years 5 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: cleaning message code

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 5 months ago [\#103870](#103870) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103870 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Hi,

Your javascript code looks good. Because I don't have same modules/filters I can't reproduce it in my local website.
Do you have a link to your store ? So we will be able to see it directly.

Thanks,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 5 months ago [\#103893](#103893) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103893 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Sent to you through the contact form.

thank you!

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 5 months ago [\#103964](#103964) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103964 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Hi,

I test your website and I don't know exactly why but, in the first link you gave, the link is not working properly.
The "onclick" is not called by the "href" yes.
Regarding the browser history, there is no "post" send to the website but a page is "get".
So no information is sent to the website in order to remove the filters.

Because there is no "post", it means that the form is not submitted.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 5 months ago [\#103967](#103967) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103967 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Thanks for your interest in analyzing the problem. To be honest I don't understand much of your statements as I'm not really a PHP coder so my comprehension is very limited. I will try to figure out how "to change something" and maybe come back to you.

Anyhow, wouldn't be easy to integrate this kind of button that resets all filters at once as a function in the component?

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

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 5 months ago [\#103994](#103994) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#103994 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Hi Jerome,

I'm going to open a new simplified open post for this topic with the hope some community member can bring some idea.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxODEyLWFzc2lzdGFuY2Utb24tYS1saXR0bGUtaGFjaz90bXBsPW1hcmtkb3du) 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: 86320
- Thank you received: 14279
-
-

13 years 5 months ago [\#104027](#104027) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Assistance on a little HACK](/forum/2-general-talk-about-hikashop/81812-assistance-on-a-little-hack#104027 "As I found some limits in the filter philosophy I managed to build a little hack to create a &quot;Clear all filter settings at once&quot; button so for my 5 filter setup I don'thave to &quot;kill&quot; five times to go...")*

Adding a "clear all" button on the filters is something high on our todo list. We'll try to add it to the next version.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzgxODEyLWFzc2lzdGFuY2Utb24tYS1saXR0bGUtaGFjaz90bXBsPW1hcmtkb3du) 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.094 seconds

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

[](#top)
