I have the same contact form iframe from one domain on multiple pages at another domain. I'd like to be able to capture the parent page URL in a field in my iframe form. Is this possible? I'd prefer to use javascript.
Asked
Active
Viewed 83 times
0
-
1Possible duplicate of [Access parent URL from iframe](https://stackoverflow.com/questions/3420004/access-parent-url-from-iframe) – GalAbra May 06 '18 at 15:37
-
Not duplicate because I need to 'pull' the URL into the iframe - not 'push' it from the parent page. – Ted Lederer May 06 '18 at 23:00
1 Answers
0
document.referrer will hold the parent url

S.Moran
- 151
- 1
- 7
-
Thanks. Where would I put that? I am not very proficient in JS yet. A sample page would be http://transcourt.com/bulk-tanker/ - with the iframe at the bottom being located at http://transcourt-iframe-form.sharing-online.net/. The second page of the form is 2nd-form-english. That's where the form field is that needs populating with the Parent URL. – Ted Lederer May 06 '18 at 22:59
-
I have had the website owner add to this page - along with the script . The idea was to pass the subject of the site into a field in the iframe - so I could tell what page the contact was on when they visited the site. – Ted Lederer May 06 '18 at 23:34