I have this form:
<form id="filter_form">
<select name="type">
<option value="second">second</option>
</select>
<input type="checkbox" name="city[]" value="new_york" />
<input type="checkbox" name="city[]" value="washington" />
</form>
and this event in js:
$('#filter_form').on('change', function () {
$.ajax({
url: "properties",
method: 'GET',
data: $("#filter_form").serialize(),
success: function(result){
}
});
});
In this moment the url is built like this:
properties?transaction_type=second&city%5B%5D=new_york&city%5B%5D=washington
but I need
properties?transaction_type=second&city=new_york,washington
How can I make this join?
UPDATE EDIT:
This method will help me but I can't find a way to implement:
array.map(function() {
return this.value;
}).get().join(',');