-
- Show a Form Only to Logged-In Users
- How to Increment a Count on Each Form Submission
- Adding an “Other” Option
- Adding a Unique ID to Each Form Submission
- Show or Hide Form Fields Based on User Joomla User Group
- Disabling Browser Autocomplete for Form Fields
- Scroll the Page to the Top When a Long Form is Submitted
- Display Submissions Count for a Specific Form
- Populate Drop Down, Radio Buttons or Checkboxes with a CSV File
- Automatically Delete Submissions Older Than X Days
- Silently POST Submitted Data to Any API or URL
- Automatically Save Each Submission to a JSON file
- Authenticate and Login a User with a Custom Joomla Form
- Auto-Populate a Form Field with an Article Data
- Add a placeholder text to a Dropdown field
- Create Multilingual Forms in Joomla
- Redirect User to a URL After Form Submission
- Importing and Exporting Forms
- Exporting Form Submissions
- Display Convert Forms in a popup
-
- How to Create a Quiz Form
- Displaying a Popup After Form Submission Using EngageBox
- Using the Conditional Content Shortcode in Convert Forms
- Copy Value From One Field to Another
- Submission Tasks
- Exporting Form Submissions with a Webhook URL
- Conditional Fields
- PDF Form Submissions
- Working with Input Masks
- Field Calculations
- Auto-Populate Form Fields Using Query String
- Smart Tags
-
- Enable Minimum Time to Submit
- Restrict Form Submissions Based on IP
- Enforcing a Custom Password Policy in Convert Forms
- Add Cloudflare Turnstile to your Joomla Form
- Implement the Iubenda Consent Database in Joomla with Convert Forms
- Add Custom Validations to Fields and Forms
- Add Math Captcha to your Form
- Prevent a Field From Saving in the Database
- Add hCaptcha to your Form
- Enable Double Opt-in
- Allow Form Submissions in Specific Date Range
- Ensure a Unique Value is Entered Into a Field
- Block Form Submissions Containing Profanity (Bad Words)
- Block Email Addresses or Email Domains
- Honeypot
- Setting Up Google reCAPTCHA
- Create GDPR Compliant Forms
Show a Form Only to Logged-In Users
Sometimes you only want logged-in users to see a form — for example, when collecting private data or offering something exclusive. In this guide, we’ll walk you through how to hide a form from guests and show a helpful message instead, including a link to the login page.
Hide the Form From Guests
To hide the form from guests, edit your form, go to Behavior > PHP Scripts > Form Display, and add:
if ($user->guest)
{
$formLayout = '';
}
Show a Message to Guests with a Login Link
To inform your guests that this form is only accessible to logged-in users, you can display a helpful message that includes a login link, notifying them that they must log in first.
To add this helpful message, edit your form, go to Behavior > PHP Scripts > Form Display, and add:
if ($user->guest)
{
$loginUrl = \Joomla\CMS\Router\Route::_('index.php?option=com_users&view=login');
$formLayout = sprintf('You must <a href="/%s">log in</a> first before you can view this form.', $loginUrl);
}
Last updated on Jun 3rd 2025 17:06