Streaming live at 10am (PST)

Collect IP Address Hidden Field Forms


#1

Hi Webflow guys and girls :slight_smile:

First off not sure if this is possible but has/does anybody know who to collect IP address in a hidden webflow form?


#2

https://stackoverflow.com/q/19953328/584192

Instead of alert, you want to set the value of a field like this

$('#my-field-id').val(response.ip);

Here's a longer list if you want to compare web services: https://stackoverflow.com/q/391979/584192


#3

@samliew thanks Sam, but which of those answers code do you suggest I use?
I'm not to sure how to implement this sorry


#4
$.get("https://ipinfo.io", function(response) {
    $('#my-field-id').val(response.ip);
}, "jsonp");

#5

Just add this to custom code with my form id in it? Sorry for been such a noob...


#6

Put in page footer code. Replace my-field-id with id of the hidden field.


#7

Thanks champ, ill try my best to get this working


#8

Hi all. This isn’t working for me and I’m hoping someone can help. I have a live site that should be collecting IP Address using this method but nothing is coming in to the form. The IP was coming through at one point but it’s not anymore and the form is integrated with a Zapier set up that needs the IP to work. Thanks a million
screen4


#9

@Niall_Mc_Dermott

Welcome to the Webflow forum!

Could you please edit Screenshot_2017-08-16_140811 and provide ALL the necessary details in your post so we can take a look at your site/issue?

In future if you want faster replies and more accurate answers, I suggest including all the details listed in the link above before someone has to ask.

Hope to hear from you soon. Thanks!


#10

Thanks for the reply Samliew,

The site is: https://www.lucozadesportwhatwall.com/

or http://autovation-lucozade.webflow.io/

My preview link is: https://preview.webflow.com/preview/autovation-lucozade?preview=ce51c5c4f5eb3abf2b2fb80740115b7f

Thanks a lot


#11

Your site is using HTTPS, that may conflict with HTTP resources.

Try changing it to HTTPS.


#12

Cheers. It’s hosted on Webflow with https: https://www.lucozadesportwhatwall.com/


#13

I meant your script is accessing a non secure website.


#14

Thanks a million. You solved it. I appreciate that a lot.

The code I was working from had no ‘s’.

This is what I had:

Works with: