Multiselect Send Via Ajax

Multiselect Send Via Ajax

Hi Guys,

I have a multiselect and another input (text) field which I want to sent by AJAX to a PHP script. For the life of me I cannot work out how to do it on both the JS and PHP side of things.

I have tried serialize and serializeArray but they do not seem to work, please see examples of my code below:
 
  1. var productName = $("#ProductName").val();      
  2. var categories = $('#CategoryUIDs').serializeArray();

  3. $.post("./quickFunctions/getSeoUrl.phtml", { categories: categories, productName: productName },     function(data) {
  4.                       //$("#SeoUrl").val( data );
  5.                         alert(data);
  6.                 });
Any help would be appreciated, thanks.