All extensions are free now. Because it was coded by Russians.

K2 Multiple Extra Fields Filter

Please Log in or Create an account to join the conversation.

#
Hi, I have a series of filters that are currently accumulative.
What I need is: when a filter is selected, a new search is made. I need the active filter to be removed.

For example, in the attach:
If I select the "UbicaciĆ³n" filter first, then if I select the filter "Estado" I would like the "UbicaciĆ³n" filter to be unselected.

Is it possible?
Regards!
Attachments:

Please Log in or Create an account to join the conversation.

#
Hello, Eiosipescu.

Thanks for your post.

Yes, it is possible with some custom javascript. Could you provide me a link on your site for check it?

Please Log in or Create an account to join the conversation.

#
Hi molotow,

This is the url: 162.211.82.155/~amanciowilliams/

The filters are the first two: Obras & Textos.

I look forward to your feedback, thanks!

Please Log in or Create an account to join the conversation.

#
Sorry, the url should not have https (only http):

162.211.82.155/~amanciowilliams/

Please Log in or Create an account to join the conversation.

#
eiosipescu,

Please, try to use the following code, you can put it in modules\mod_k2_filter\tmpl\Default\elements\basic_scripts.php, just after jQuery(document).ready(function() { at the top.

jQuery("#K2FilterBox<?php echo $module->id; ?> select").removeAttr("onchange");
jQuery("#K2FilterBox<?php echo $module->id; ?> select").on("change", function(event) {
	event.preventDefault();
	var el = jQuery(this);
	jQuery("#K2FilterBox<?php echo $module->id; ?> form").find("select").not(el).val(0);
	submit_form_<?php echo $module->id; ?>();
});

Please Log in or Create an account to join the conversation.

#
Thanks! It's worked perfectly.

I have one last query:
Is it possible to add a button to eliminate the applied filter?

The reset button does not work for me.

Thanks!

Please Log in or Create an account to join the conversation.

#
eiosipescu,

There just automatic form submit behavior was disabled for reset button.
You can fix it in basic_scripts.php file.

Find and remove this code:
if(isClearSearch) return false;