I want to make it so a user has to register or be logged in before they can complete a form. Is there a way to do that?

Open your form and go to the form's properties > Advanced Tab > More Options, then click on the FORM PIECES tab.

In the BEFORE FORM section, click on the CUSTOM radio button. In the text area that opens, add the following code:

 

if(  JFactory::getUser()->get('id',0) <= 0 )
{
    header("Location: index.php?option=com_user&view=register");
    exit;
}
 

 

This example assumes that you are redirecting your users to the default registration URL. You can change that to whatever location you want. Just replace this part of the code with your new URL:

index.php?option=com_user&view=register

Then click on the SAVE icon in the lower right-hand corner of the screen to save the code you just entered. Once back on the form properties screen, click the SAVE icon in the upper right-hand corner of the screen to save the form itself.

Now, when a user tries to access your form without being logged in, they will be redirected to the registration page where they can create an account or login.  

Special Offer

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!