Reputation: 1256
I have a list of tags which all get added to a hidden input with name="item[tags][]"
<input type="hidden" style="display:none;" value="first" name="item[tags][]">
<input type="hidden" style="display:none;" value="second" name="item[tags][]">
<input type="hidden" style="display:none;" value="third" name="item[tags][]">
How could i combine those hidden inputs to output
var tag_filter = first,second,third;
Upvotes: 1
Views: 61
Reputation: 779
Try some thing like this
var str = "";
$('input[name="item[tags][]"]').each(function(){
str += $(this).val()+","
})
str = str.substring(0,str.length);
Upvotes: 0