You are viewing limited content. For full access, please sign in.

Question

Question

JS for IP Address of Client Starting Form

asked on June 13, 2017

The Forms process logs the IP address of the client computer submitting the form. Is there a way to get this value prior to the form being submitted? I'd like to send the data to a stored procedure using a Lookup before the process is submitted.

0 0

Replies

replied on June 13, 2017

Hi Josh,

I found this StackOverflow article, it looks like it might work for your purposes:

https://stackoverflow.com/questions/19953328/how-to-get-ip-address-using-javascript-or-jquery

The following SO article links to various third-party web services that provide this functionality:

https://stackoverflow.com/questions/391979/how-to-get-clients-ip-address-using-javascript-only

Good luck,

Rob

0 0
replied on June 13, 2017

Note that the second questions explicitly states that they can't run any code on the server, which is why all of the answers use 3rd party sites.  It would be simple to write a web application that echoes back the client IP address, and host it on the same server as Forms.

0 0
replied on June 13, 2017

Thanks. Yeah, I've seen how to do it outside of Forms. I was hoping there was a shortcut to get it using JS or fields/functions available within Forms that I could reference without going to another site to get the info.

0 0
replied on June 13, 2017

You can add the js provided in the second link above to Forms custom script; it will send request to 3rd party site and get ip address, then you can fill a certain field with the ip address to trigger lookup rules.

1 0
replied on June 14, 2017

My challenge is that not all users who fill out these forms within our agency will have internet access. 

0 0
replied on June 14, 2017

If your users all use browsers supporting WebRTC, you could try this answer which is pure client side js.

But if your users use IE, then you have to ask a server for the IP. Consider set up your own ip query server in local network maybe.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.