So I have two options when it comes to doing something and I don't care which one I do at this point, so if you know how to answer one (or both) any help would be very greatly appreciated...
I have a ton of javascript code in the javascript function section which takes data off the dialog (latitudes and longitudes), sends it to Google Maps API to get a JSON, parses the information for polylines and does a bunch of calculations, then displays this information in a static text div under the map (miles driven per state). What I need to do is get this information (which is in an array before it's put into a div) to be put into my database. Not sure if I can just do an AJAX call to a php page or if there is an easier way within in Alpha (hoping the second part)? This brings me to my second idea, next to the displayed html on the page I have built a repeating section of textboxes where the user can type in the data and then hit submit and put it in the database table (this currently is sending the info to the database but the problem is it only sends one of the rows and populates my entire table with just that data....)?
I would prefer to just send the data to the data base from the java side of things, then in my repeating section have my textboxes auto-populated from the table so the user can make edits and then resubmit the changes? Or just auto-populate the textboxes from the javascript array values and then have the user edit and submit them to the database with the button?
I fear my issue is the fact the variables are in the javascript but this made the most sense for me as I may end up reusing this code outside of alpha. I wasn't sure if I have to create session variables from the array data or if that is even a thing? Also didn't know if I could use Xbasic to grab the array values and pass them to the data base?
I know this is very verbose but I have watched multiple videos and non of them seem to be doing quite as much on the java side of things and non explicitly talk about getting variable data out.
Thanks for any help!!!
Josh
I have a ton of javascript code in the javascript function section which takes data off the dialog (latitudes and longitudes), sends it to Google Maps API to get a JSON, parses the information for polylines and does a bunch of calculations, then displays this information in a static text div under the map (miles driven per state). What I need to do is get this information (which is in an array before it's put into a div) to be put into my database. Not sure if I can just do an AJAX call to a php page or if there is an easier way within in Alpha (hoping the second part)? This brings me to my second idea, next to the displayed html on the page I have built a repeating section of textboxes where the user can type in the data and then hit submit and put it in the database table (this currently is sending the info to the database but the problem is it only sends one of the rows and populates my entire table with just that data....)?
I would prefer to just send the data to the data base from the java side of things, then in my repeating section have my textboxes auto-populated from the table so the user can make edits and then resubmit the changes? Or just auto-populate the textboxes from the javascript array values and then have the user edit and submit them to the database with the button?
I fear my issue is the fact the variables are in the javascript but this made the most sense for me as I may end up reusing this code outside of alpha. I wasn't sure if I have to create session variables from the array data or if that is even a thing? Also didn't know if I could use Xbasic to grab the array values and pass them to the data base?
I know this is very verbose but I have watched multiple videos and non of them seem to be doing quite as much on the java side of things and non explicitly talk about getting variable data out.
Thanks for any help!!!
Josh
Comment