I have a question about adding data to an array from a table of input boxes. Here's the code I've been working on to achieve this:
Whenever I click the add button, I want the data to be stored in the variable named my_data
.
The desired output in my variable should look like this:
my_data = [{plank:"1", thickness:"4", width:"6", length:"8", qty:"1", brdFt:"16"}]
If I were to add another set of data, it should append to the variable and result in something like this:
my_data = [{plank:"1", thickness:"4", width:"6", length:"8", qty:"1", brdFt:"16"},
{plank:"2", thickness:"5", width:"6", length:"2", qty:"1", brdFt:"50"}]
My current code is not efficient, so any help would be appreciated.
Current output:
1, 4, 6, 4, 1