I am having an issue with the code that I was given as an example from a previous SO question - it is working about 95% but the order array is appearing empty why?
HTML:
<input class="order" value="<?php echo $order; ?>" type="text" />
JS:
$('body').on("click", "#brands_by_category_submit_btn", function (e) {
e.preventDefault();
var self = $(this);
var order = [];
var id = $("#manID").data("id");
var brand_name = $("#brand_name").data("id");
var data = grabData(true);
$(".order").each(function(){
order.push($(this).text());
})
if(data.length)
{
var data_array = {
id : id,
brand_name : brand_name,
cat_id : data,
order : order,
state : 1
};
var order = $(".order").map(function() { return $(this).val(); }).get();