I need to use the value of a JavaScript variable in a module.
For example, I am getting a city = 'delhi' in a JavaScript file, and I need to use this value in a module showing a form.
1 Answer
You could send that value to a callback function in your .module file using AJAX, an example to do that stuff in forms see that tutorial Ajaxify form fields
And you could send any value to js variable see sending-a-javascript-variable-to-drupal