Forums

Javascript variable to php for saving to database

easilyconfused 24 Jan, 2016
Hi

I am new to Chronoforms and very basic with coding so go easy on me!!!

Within Chronoforms I need to have the user enter an address (among other fields), for that address to display on a google map and for the address and gps coordinates (lat and lng separately) to be passed to hidden fields within the form and then saved to mysql.

I have been able to get the google maps 3 api in javascript to run in the form so that the user can type in the address and the address displays on the map.

Where i am stuck is how to get the jacascript address variable and the individual GPS coordinates for that address passed across to php so I can save them in the database.

Can anyone help me with this? As mentioned, I am new to this so if you could be very specific in your answer I would appreciate it.

Thank you.
GreyHead 25 Jan, 2016
Hi easilyconfused,

If you have them in JavaScript you can set them as the values of inputs in your form - typically you'd use hidden inputs for this but they don't have to be.

Bob
This topic is locked and no more replies can be posted.