Although the IP address is not always correct (VPN), here is a quick way to add the IP address to a from
First, create and HTML field below the field that will hold the IP (field needs to be available to be populated). This is what goes there:
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
<script>
/* Add "https://api.ipify.org?format=json" statement
this will communicate with the ipify servers in
order to retrieve the IP address $.getJSON will
load JSON-encoded data from the server using a
GET HTTP request */
$.getJSON("https://api.ipify.org?format=json", function(data) {
// Setting text of element P with id gfg
$("#gfg").html(data.ip);
jQuery('#input_147_30').val(data.ip);
})
</script>
The bolded input field needs to updated to the field that will have the IP address. This example it is Form #147 and Field #30.
It would be assumed that CSS would be used to hide this field on the frontend (from the user), but be displayed when viewed on the backend.