Highlighted

How to assign IP address to Textfield

Avatar

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

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
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

Avatar

Avatar

_James_J_Gallag

Avatar

_James_J_Gallag

_James_J_Gallag

03-10-2008

Has anyone been able to access the IP address of the client by using JavaScript??
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

03-10-2008

You cannot get access to that information from javascript insode of the PDF.
Highlighted

Avatar

Avatar

Luigi_247_365

Avatar

Luigi_247_365

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