I have found Javascript to be the most difficult language to find useful and CORRECT info on. Afterr working for several hours looking at various sites, I'm still somewhat stumped.
All I know at this point is that these is a difference in the array formatting between PHP and JS. The magic bullet is supposed to be json.
However, this code does not work as advertised.
javascrript snippet:
var pt = <?PHP json_encode($prt); ?>
The variable $prt is list of associative arrays, so to get a value in a particular row manually , $prt[0] should give me the value for location in the first row of output.
All of this works just fine if i hard code this in html and php.
However, I want to dynamically produce the rows as needed which requires that a loop employed. The application also requires that the user may add a row which also need to be accounted for when posting.
After many experiments, I think the best solution is to make this a totally javascript entity .All I need to do is to be able to pass in the server side data. Calling JS from PHP does not work, although i have found many places where they show basically the same code , claiming that it works.
I think json needs a bit of tweaking to make this happen, but i'm not sure how to proceed.