I am facing a crisis here. I have a textbox, named businessInfo_businessAddress, which contains client's address loaded from the database when the page is loaded. I have a hidden field, named tracking-select-business-country-code
which is supposed to store the country code after the google map api is called.
And in document.ready I have a piece of code that trying to call that function like this
I got this error in console.log
Uncaught TypeError: Cannot read property 'value' of null
I guess it must have something to do with variable autocomplete but I don't know how to handle this problem. I need after the form finishes loading (ie. $(document).ready is called), google map api must be called with the value contained in the textbox businessInfo_businessAddress (for example: "Atlanta, GA, United States") and return the country code for hidden field tracking-select-business-country-code. I wonder how can I do that? What change do I need to make in the code? Please help!!! Thanks everyone.