diff --git a/includes/custom-field-ajuts-filter-function-frontend.php b/includes/custom-field-ajuts-filter-function-frontend.php index 066111d..b5d4fd4 100644 --- a/includes/custom-field-ajuts-filter-function-frontend.php +++ b/includes/custom-field-ajuts-filter-function-frontend.php @@ -100,7 +100,8 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ): (function($) { // change - $('#archive-filters').on('change', 'input[type="checkbox"]', function(){ + //$('#archive-filters').on('change', 'input[type="checkbox"]', function(){ + $('#archive-filters').on('click', 'button', function(){ // vars var url = ''; @@ -112,19 +113,17 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ): // vars var filteredajuts = $(this).data('filter'), vals = [], - allvalueschecked = ''; + allvalueschecked = []; // find checked inputs $(this).find('input:checked').each(function(){ vals.push( $(this).val() ); var thisvaluechecked = $(this).val(); - allvalueschecked += thisvaluechecked + ','; urldos += filteredajuts; - alert( urldos +"=" +allvalueschecked); }); // append to args args[ filteredajuts ] = vals.join(','); - + alert( filteredajuts +'=' +args[ filteredajuts ]); }); // update url @@ -141,10 +140,10 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form' ) ): url = url.slice(0, -1); // reload page - $('#archive-filters button').on('click', function () { + //$('#archive-filters button').on('click', function () { alert( "estoy en: " +url ); //window.location.replace( url ); - }); + //}); });