I have html form with names like ...name="bulk[]".... Is there way to get all values of bulk in array with jquery? Ex
$('[name*="bulk"]').val().join('|');// this is incorrect just to show how I need that
I have html form with names like ...name="bulk[]".... Is there way to get all values of bulk in array with jquery? Ex
$('[name*="bulk"]').val().join('|');// this is incorrect just to show how I need that
.map() is made for this purpose
var myarray = $('[name^="bulk"]').map(function(){
return $(this).val()
}).get();
You can use .map() to add the names
var myarray = $('[name^="bulk"]').map(function(){
return $(this).val()
}).get();