I have a javascript function that reads an entire form into a serialized
 $.ajax({
    type: 'POST',
    url: '/cart/update.js',
    dataType: 'json',
    data: $("#add-to-cart").serialize() + '&id=' + $("select[name=id]").val(),
    success: goToCart,
    error: goToCart
  });
However it seems to be not organizing the data. It should be pattern, line 1, line 2, line 3, line 4, line 5, line 6, however it seems to be going line 1, line 2, line 3, line 4, pattern, line 5, line 6.
Is there a way to sort the serialized data somehow?
html is in proper order, pattern is first then lines 1-6.
Any help?
 
     
    