- krp54Asked on November 21, 2012 at 07:57 AM
Thank you for the script, but i can't get it working on my website. try clicking this button http://prntscr.com/k8ftt
on a webpage: http://krp54.ru/XT-120.html
Can you help please?
This is a re-post of a comment on Capture the Page URL Where the Form is Embedded
- JotForm SupportidarktechAnswered on November 21, 2012 at 08:08 AM
- livingfreshAnswered on November 21, 2012 at 08:32 AM
Hi! Thank you,
but i've got this stuff above the head after inserting a script provided. http://prntscr.com/k8ly8
- JotForm SupportidarktechAnswered on November 21, 2012 at 08:43 AM
Thanks for the prompt response. This is how it displays on my Chrome, IE and Firefox Browser as of this writing.
Please be sure to replace the existing codes correctly. There's actually no changes on the code except the spacing on the last iframe closing tag e.g. </" + "iframe>");
Here's the code again:
document.write("<iframe allowtransparency=\"true\" src=\"http://www.jotform.com/form/23252177142346?referrer=" + window.location.href + "\" frameborder=\"0\" style=\"width:100%; height:164px; border:none;\" scrolling=\"no\"></" + "iframe>");
- livingfreshAnswered on November 21, 2012 at 09:00 AM
thank you, now i've got it working, i've just changed the url to www.jotformeu.com/...
Then i have another problem - by button click i load a page credit_form.html to the fancybox and i'm getting a url that shows /credit_form.html as a referrer neither than /XT-120.html - from where the submission really came from.
How to make it work properly?
- JotForm SupportidarktechAnswered on November 21, 2012 at 10:12 AM
That's great! Glad to hear you've managed to sort it out.
That's simply because the form is embedded at credit_form.html (on a separate html page) and this is the main reason why it shows this URL as a referrer. Unfortunately, this is how the script works. In order to make this working properly you have to place the embed code directly on the page where you'd like to get its referrer e.g. at XT-120.html
Another alternative solution is to use a lightbox embed code and use its parameters in order to get the correct referrer.
Thanks and apologies for the delay.
- JotForm SupportidarktechAnswered on November 21, 2012 at 10:45 AM
You can use the following lightbox code if you like.
windowTitle:'Заявка на кредит',
<a class="lightbox-23252177142346" style="cursor:pointer;color:blue;text-decoration:underline;">Заявка на кредит</a>
It should function like this: http://idarktech.com/test_lightbox_code.html
- krp54Answered on November 22, 2012 at 03:22 AM
Hi, thank you!
This is a solution,
However, is it possible to get a parameter of a page where the iframe is opened?
- fxrAnswered on November 22, 2012 at 03:30 AM
That is what it is doing, the referer variable is set to the value of the page which contains the link to the iframe/lightbox.
- livingfreshAnswered on November 22, 2012 at 08:33 AM
Can't understand how to get it working.
I have a ./xt-120.html page and i load a fancybox iframe on buttonclick with ./credit_form.html page content that has a form embedded.
How can i pass a ./xt-120.html URL or any other unique parameter to the hidden form field "referrer" ?
- JotForm SupportNeilVicenteAnswered on November 22, 2012 at 08:47 AM
The guide How to Know the Exact URL of a Page From Which a Submission Came applies only to forms embedded using iFrame or script-based Embed codes. However, you are using a custom script for "lightbox-ing" your form, so this is a little tricky because the form is embedded on xt-120.html that is linked from credit_form.html. The actual referrer is xt-120.html because it is the one that calls the form from our servers.
Can't you just use our built-in lightbox script to embed your form, as opposed to embedding the form in a separate page and opening that page via fancybox?
Your setup will require extra cumbersome steps in order to capture the referrer URL, whereas our built-in lightbox script will only need a few lines of additional code.
Please let us know you're okay with the alternate solution we propose, and we will walk you through it.
- livingfreshAnswered on November 22, 2012 at 10:05 AM
ok, let's do it. Let's embed the lightbox (last time when i tried to embed a form via lightbox i got conflicts with jquery versions)
- JotForm SupportNeilVicenteAnswered on November 22, 2012 at 10:20 AM
1. Embed the codes provided by idarktech to your form website. Here's a cleaner version:
2. In your page's source code, find the reference to jQuery library
3. Paste the following code right after the jQuery reference:
So it becomes:
4. Save your webpage
- livingfreshAnswered on November 22, 2012 at 11:12 AM
thank you, i've got it done, everything works fine.
here is another task:
what if i have several buttons on a page calling the same form? and i need these buttons to bypass a unique parameter to the referrer field.
therefore i should keep one copy of the script inside the page and change referrer parameters, right? Could you please help to manage it?
- livingfreshAnswered on November 22, 2012 at 11:23 AM
*change referrer parameters by onbuttonclick event.
looking for your response
- JotForm SupportNeilVicenteAnswered on November 22, 2012 at 12:04 PM
We'll try to make this work for you. We'll get back to you with a solution.
Thank you for your patience.
Sorry for taking too long to update you. Unfortunately, after playing around with the feedback codes, I was not able to find a solution to your requirement.
What you want to accomplish is not quite possible. Sorry about that.