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. 




Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!