[ad_1]
Hi,
I need a solution to the following problem.
The following code displays the results table of a form usage:
[CP_CALCULATED_FIELDS_RESULT_LIST formid=”1″ layout=”table” table_head=”IP,Name,Email,Results,Link” table_fields=”ipaddress,fieldname1,fieldname2,fieldname3,thank_you_page”]
Instead of the IP, I would like to display the location.
For this I used the following script, but I don’t know how to insert it in the results table.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input class="ip" value="">
<button class="send">Vezi adresa IP</button>
<span class="city"></span>,
<span class="country"></span>
<script>
$('.send').on('click', function () {
$.getJSON('https://ipapi.co/' + $('.ip').val() + '/json', function (data) {
$('.city').text(data.city);
$('.country').text(data.country);
});
});
</script>
