I have my form set up in a module position. I want to collect the title of the page that they are on when they submit the form.

To capture the page location, create a new element of type HIDDEN INPUT. For this example, let's name that element PageTitle. The value field in the element should be empty.

Click on SAVE PROPERTIES to save the new element, and then click on the SAVE icon in the upper right-hand corner of the screen to save itself. In the INITIALIZATION SCRIPT section, click on the CUSTOM button. Then click on the "Create code framework" text. A message will popup saying:

Create code framework for init now?

(Existing code will be appended)

Click OK.

A textarea will appear with code in it that looks similar to the following:

function ff_YourFormName_init()
{

} // ff_YourFormName_init

On the line right below the first curly bracket -- { -- add the following code:

ff_getElementByName('PageTitle').value = window.parent.document.title;

So the final code should look something like this:

function ff_YourFormName_init()
{
     ff_getElementByName('PageTitle').value = window.parent.document.title;
} // ff_YourFormName_init

Note: If your hidden element is named something other than PageTitle, then you will need to change that in the code above.

Click on the SAVE button at the bottom of the screen to save the script changes, and then click on the SAVE icon in the upper left-hand corner of the screen to save the form itself. 

 

 

 

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

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