MikeDDDD Posted January 30, 2020 Report Share Posted January 30, 2020 I am using the following code but doesn't seem to store the document.referrer string. What am I doing wrong? <script type="text/javascript"> document.addEventListener("DataPageReady", function (event) { document.getElementById('cbParamVirtual7').value = document.referrer; }); </script> Quote Link to comment Share on other sites More sharing options...
geoffdude Posted January 30, 2020 Report Share Posted January 30, 2020 Where, and how, are you placing the code? * I tried your code and it works for me. Quote Link to comment Share on other sites More sharing options...
MikeDDDD Posted January 30, 2020 Author Report Share Posted January 30, 2020 I have this script in the footer of a submission form. (I have tried html as the very last field also but with no luck) Virtual7 is set to render value as text. My goal is that once Virtual7 receives the document.referrer string, it then gets passed as a parameter to a report datapage. I want it to print on the report page, but get a blank result. Thanks for checking this out for me. I've been stuck on this for a few days now. Quote Link to comment Share on other sites More sharing options...
geoffdude Posted January 30, 2020 Report Share Posted January 30, 2020 Do you have the Virtual7 form field set as: Form element: Text Field If you have Virtual7 set as display only like: Form element: Display Only it won't work. Quote Link to comment Share on other sites More sharing options...
MikeDDDD Posted January 30, 2020 Author Report Share Posted January 30, 2020 I appreciate your help. It was set to display only. (never would have guessed that!) I have switched it to a text field but am still getting a blank on the report page. I pass it as a parameter to another virtual field in my report datapage (received onload). I have that Virtual filed set to display only. Does it need to be a text field as well? Quote Link to comment Share on other sites More sharing options...
MikeDDDD Posted January 30, 2020 Author Report Share Posted January 30, 2020 This is my test application if it helps. The virtual field that receives the parameter should be the first one displayed (right under search again). http://n0x.c24.myftpupload.com/dealer-new-system-select-tool/ Quote Link to comment Share on other sites More sharing options...
geoffdude Posted January 30, 2020 Report Share Posted January 30, 2020 You need to pass the "Virtual7" value as a "parameter" in your form's advance setting for that field- such as: On exit: Pass field value as parameter: [@Virtual7] Then on your report page have that virtual field set as display only, but also have it set to receive the parameter: Receive value or parameter: External Parameters = [@Virtual7] Quote Link to comment Share on other sites More sharing options...
geoffdude Posted January 30, 2020 Report Share Posted January 30, 2020 Also .. the referrer field will ONLY capture the domain address if the previous page links to your page. It must be a REFERRING domain.. so an active page on a live domain will work .. testing from your 'puter on a local page (from your 'puter) will not. Quote Link to comment Share on other sites More sharing options...
MikeDDDD Posted January 30, 2020 Author Report Share Posted January 30, 2020 I finally got this to work. I was loading it as a referral from an active live domain, but apparently if the link opens in a new window it does not work. As soon as I changed that it started displaying the domain. Not critical, but if you know of a workaround, please share. I can't thank you enough for guiding me toward this present solution. Bravo Sir! Quote Link to comment Share on other sites More sharing options...
geoffdude Posted January 31, 2020 Report Share Posted January 31, 2020 What was your code for the link opening a new window? Were you using <a href="somecaspioURL" target="_blank"> LINK HERE</a>? The code target="_blank" works for me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.