From 99b0a39d3f57e3c93a43d5729f6ca3acae67d900 Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Thu, 12 Jan 2023 09:07:06 +0100 Subject: [PATCH] functionto $_POST url constructed with js method 02 --- .../custom-field-ajuts-filter-function-frontend.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 ); - }); + //}); });