functionto $_POST url constructed with js method 02
This commit is contained in:
parent
e03b38f8e8
commit
99b0a39d3f
|
@ -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 = '<?php echo home_url('ajuts/'); ?>';
|
||||
|
@ -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 );
|
||||
});
|
||||
//});
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue