I’ve been using Serialize() to pass checkbox form data with Post() for a basket that can hold multiple items of the same category.
When I post them using the submit button it works fine with multiple values being passed and displayed under one category.
However when I used Jquery serialize() it will only show one item per category and only two categories in total. This is an array issue but I cannot work it out.
Is there an alternative JQuery function i should be using to pass a multi-dimensional array?
Jquery will take multi dimensional arrays directly, no need to serialize.
_Post Data in your PHP file would look like this
Once you define your data multidimensional array, your Ajax could be as simple as
If your post array may have fields that you don’t know about, you can access your Post array in your php file easily with