jaydiprewa Posted June 27, 2023 Share Posted June 27, 2023 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $.getJSON('https://api.ipify.org?format=json') .done(function(data) { var ipAddress = data.ip; $.getJSON('https://ipapi.co/' + ipAddress + '/json') .done(function(data) { $('input[name="SQF_IP_ADDRESS"]').val(ipAddress); $('input[name="SQF_CITY"]').val(data.city); $('input[name="SQF_COUNTRY"]').val(data.country); }) .fail(function() { console.error('Failed to retrieve city and country information.'); }); }) .fail(function() { console.error('Failed to retrieve IP address.'); }); }); </script> This code does not pass the hidden values to email. I've already created a hidden field with the exact name. let me know Link to comment
tuanphan Posted June 28, 2023 Share Posted June 28, 2023 You try enable this option Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
bluelakes Posted June 30, 2023 Share Posted June 30, 2023 Hi jaydiprewa, Did you figure it out? I'm trying to do the same thing. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment