Receive the reference to the page where the form is linked

  • camacor
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 0

camacor created the topic: Receive the reference to the page where the form is linked

Hi!

I would like that when a user gives the link on a page that takes them to a form, I get in the mail along with the form information the page from which you have accessed the form.
An example:
my website has a motorcycle catalog. When they are on the page of a specific motorcycle model (for example an aprilia shiver 750) I have a button that says "request information" that leads to the contact form. I would like to have "requested information about the Aprilia shiver motorcycle" along with the information on the form. Is this possible?

Thanks.

Best regards,

Carol.
#233621
  • Posts: 2147
  • Karma: 75
  • Thank you received: 277

mihaela replied the topic: Receive the reference to the page where the form is linked

Hello,

To get the URL of the previous page that took users to form, follow this steps_

1) Create a new element in your form of type "Hidden input" and give it a name, for example, "url"

2) Go to form's Advanced properties > More options > Scripts and in Initialization Script section set Type to Custom.

In the code area below put the following code:
function ff_formname_init()
{
var urlFrom = document.referrer;
ff_getElementByName('url').value = urlFrom;

}
NOTE: In the code area above replace formname with the Name of your form.
Then in the the record of this submission, you will see in the URL of the previous page.

Let me know whether you've managed to set this for your form and whether it works as you wanted.

Regards,

Mihaela
#233632
  • camacor
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 0

camacor replied the topic: Receive the reference to the page where the form is linked

Hi! thank you for your answer. I tried all what you said but now the form don't work. I have put this:
función ff_Formulario_contacto_init ()
{
var urlFrom = document.referrer;
ff_getElementByName ('url'). value = urlFrom;

}

What Can I do?

Best regards.
#233653
  • Posts: 2147
  • Karma: 75
  • Thank you received: 277

mihaela replied the topic: Receive the reference to the page where the form is linked

Hello again,

Have you created an element with a Nameurl in your form?

Also, I see that in the code that you've sent you have "función" instead of "function".

Please correct it and let me know the result.

Regards,

Mihaela
#233660
  • camacor
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 0

camacor replied the topic: Receive the reference to the page where the form is linked

Hi! Yes I've created a hidden input element called "url".
I changed "función" to "function" and now the form works, but it don't send the url at the admin email.
I put this at admin's email:
"Ha recibido el siguiente 'Formulario de Contacto':


{nombre:label} : {nombre:value}
{telefono:label} : {telefono:value}
{email:label} : {email:value}
{codigo_postal:label} : {codigo_postal:value}
{consulta:label} : {consulta:value}
Formulario enviado desde: {url:label}{url:value}"

The admin recieve this field empty "Formulario enviado desde: "
What Can I do?

Thanks.

Best regards.
#233684
  • Posts: 2147
  • Karma: 75
  • Thank you received: 277

mihaela replied the topic: Receive the reference to the page where the form is linked

Hello,

I'm glad that changing "función" to "function" made the form work.

Please submit a test form and then go to BreezingForms > Manage Records. In the record of your last submission check whether the value of the "url" field is saved.

That is important to diagnose whether the problem is present only in email or this field's value isn't saved at all.

Let me know the result.

Regards,

Mihaela
#233702
Moderators: ForumSupporttomeperica
Time to create page: 0.120 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here