Here is a script.
It provides some select inputs which allow picking from various types of options. When the submit button is pressed it records the data in mats
and pushes the mats
array into an array called materialsUsed
. Everytime the submit button is clicked a new array is added in materialsUsed
.
I want to know how to send the materialsUsed
array through a URL to php to extract the data there and insert it into an array created in PHP.
var mats = [name= "", thick= "", size= "", quantity= 0, price= 0];
mats.name = document.getElementById("mat").options[document.getElementById("mat").selectedIndex].value;
mats.thick = document.getElementById("thick").options[document.getElementById("thick").selectedIndex].value;
mats.size = document.getElementById("size").options[document.getElementById("size").selectedIndex].value;
mats.price = parseFloat($('#priceto').val()).toFixed(2);
mats.quantity = parseInt($('#quant').val());
materialsUsed.push(mats);