Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How to assign IP address to Textfield

Not applicable
I want to assign the client's (person who is filling in the form) IP Address to a textfield called IPAddress. I know that I have to use a javascript command but I am not sure how to assign a value to the textfield.
4 Replies
pguerett
Level 10
Level 10
I do not believe that you can access the IP address of the client programmatically, but assuming that you did to ssign a value to a field you would use the follow syntax:



fieldname.rawValue = "assigned value";



Note that the fieldname and method/properties are case sensitive.
_James_J_Gallag
Level 3
Level 3
Has anyone been able to access the IP address of the client by using JavaScript??
pguerett
Level 10
Level 10
You cannot get access to that information from javascript insode of the PDF.
Luigi_247_365
Level 2
Level 2
Most probably

PDFs "limited" javascript for designer doesn't allow access outside the PDF for security purposes.



Work Around:

Assuming your displaying your PDF on a website --> if you can, pass the IP address as a parameter to the PDF document.



Example:

http://localhost/yourPDF.pdf?ip=193.65.23.84



In your PDF document javascript:

event.target.URL

// cut your URL parameters up to get what you need



then: fieldname.rawValue = ipExtractedFromURL



Associated methods that will be needed to help you out.

decodeURI(decodeURIComponent(%20) will result in a blank space