Answer the question
In order to leave comments, you need to log in
How to search for a JSON element and redirect?
When submitting the form on submit, you need to go to the address (which is formed as shown below), there will be a json file in which you need to find the value and redirect to it. What are the ways to find the required value and redirect to it when you click on submit.
$('.form').submit(function() {
var newUrl = 'https://' + 'mysite.com' + $(this).attr('action') + '?set_filter" + $('.form').serialize() + '&ajax=zap';
window.location.href = newUrl;
return false;
});
<form class="form" action="/catalog/acs/" method="get">
<div class="main__text">Filter</div>
<div class="col col-one">
<label class="label__type" data-url="type">Type</label>
<input type="checkbox" name="filter1" value="">
<input type="checkbox" name="filter2" value="">
</div>
<button class="button" type="submit">OK</button>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question