Highlighted

How to assign IP address to Textfield

Avatar

Guest

24-06-2008

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.

Replies

Highlighted

pguerett

25-06-2008

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.
Highlighted

Luigi_247_365

08-10-2008

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