0
How do I attach an array, via jQuery/AJAX, and continue to receive 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] =>
)
)
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 attached to this data the following object:
JSON.stringify(checkedItems)
, where checkedItems is an array checkedItems = {};
Obs.: tried to use new FormData()
and append
, unsuccessful.