How do I attach an array, via jQuery / AJAX, and continue to get the data in a PHP page in the following structure:
Array
(
[cadeia-suprimento] => Produto final
[produto] => 2
[categoria] => 4
[subcategoria] => 15
[descricao] => Alasca
[medida] => M
[supMaxima] =>
[comunicacaoMotor] => 1
[acabamento] => 3
[dimensao] => 19MM
[codigo] => PN-0001
[preco-custo] => 175,00
[preco-venda] =>
[composicao] => Array
(
[0] => 1
)
[percentComp] => Array
(
[0] =>
)
)
Current jQuery:
jQuery.ajax({
url: "actions/cadastrar-material.php",
type: 'post',
enctype: 'multipart/form-data',
data: $('#formCadMaterial, #formComposicao').serialize(),
success: function(data){
}
});
I need to pass the following object attached to this data:
JSON.stringify(checkedItems)
, where checkedItems is an array checkedItems = {};
Obs. : I tried to use new FormData()
and append
, without success.