-
- Managing Form Submissions
- Searching and Filtering Submissions
- Submission Tracking Data
- Customizing Submission Columns
- Editing Submissions
- Deleting Submissions
- Importing Submissions
- Exporting Submissions
- Exporting Submissions with a Webhook URL
- Tracking the User's IP Address
- Disable Submission Storage
- Auto-Delete Old Submissions
- Auto-Save Each Submission to a JSON file
- Increment a Count on Each Submission
- Add a Unique ID to Each Submission
-
- Set up Auto-Responder Emails
- Email the Person Who Filled Out the Form
- Send an Email Only When a Checkbox Is Checked
- Attach the Submission PDF to Emails
- Send Email Based on Drop Down Selection
- Send Different Email Content Based on Form Responses
- Styling Emails with CSS
- Sending Plain-Text Alternative Body Emails
- Troubleshooting Email Delivery
- Tracking Sent Emails
- Resending Emails
-
- Browser Autocomplete for Form Fields
- Redirect to a Menu Item After Form Submission
- Show a Form Only to Logged-In Users
- Adding an “Other” Option
- Show or Hide Form Fields Based on User Joomla User Group
- 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
- Silently POST Submitted Data to Any API or URL
- Create a Custom Login Form
- Auto-Populate Fields with 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
- Display Convert Forms in a popup
-
- 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
Auto-Populate Fields with Article Data
You may need to populate your form fields with data from the article where the form appears. This means you can set value to your form fields from both the article data as well as the article's custom fields data. Below you can find a PHP snippet for each version.
Setup
Populate a form field with the article's title
Using Smart Tags
Convert Forms provides an {article.KEY} Smart tag that helps you easily grab information from the current article the form resides in.
To grab the article title and store it in a form field, simply go into your Form > Field > Default Value and set it to: {article.title}
Using PHP
To populate a form field with the article's title, copy the code shown below and place it into the PHP Scripts → Form Prepare area of your form.
// Enter the name of the field to save the value
$fieldName = 'title';
// Optionally set the article's ID. Don't touch it to load current article.
$articleID = $app→input→get('id');
// Do not edit below
// Ensure article exists
$query = $db→getQuery(true);
$query→select('*')→from('#__content')→where('id=' . $db→q($articleID));
$db→setQuery($query);
if ($db→loadObject())
{
$app = \Joomla\CMS\Factory::getApplication();
$mvcFactory = $app→bootComponent('com_content')→getMVCFactory();
$model = $mvcFactory→createModel('Article', 'Site');
$model→setState('params', $app→getParams());
$article = $model→getItem($articleID);
$form['fields'][$fieldName]['value'] = $article→title;
}
Populate a form field with the article's author email
Using Smart Tags
Convert Forms provides an {article.KEY} Smart tag that helps you easily grab information from the current article the form resides in.
To grab the article title and store it in a form field, simply go into your Form > Field > Default Value and set it to: {article.user.email}
Using PHP
To populate a form field with the article's author email, copy the code shown below and place it into the PHP Scripts → Form Prepare area of your form.
// Enter the name of the field to save the value
$fieldName = 'title';
// Optionally set the article's ID. Don't touch it to load current article.
$articleID = $app→input→get('id');
// Do not edit below
// Ensure article exists
$query = $db→getQuery(true);
$query→select('*')→from('#__content')→where('id=' . $db→q($articleID));
$db→setQuery($query);
if ($db→loadObject())
{
$app = \Joomla\CMS\Factory::getApplication();
$mvcFactory = $app→bootComponent('com_content')→getMVCFactory();
$model = $mvcFactory→createModel('Article', 'Site');
$model→setState('params', $app→getParams());
$article = $model→getItem($articleID);
// Load author's user data
$author = JFactory::getUser($article→created_by);
$form['fields'][$fieldName]['value'] = $author→email;
}
Populate a form field with an article's custom field value
Using Smart Tags
Convert Forms provides an {article.KEY} Smart tag that helps you easily grab information from the current article the form resides in.
To grab the article title and store it in a form field, simply go into your Form > Field > Default Value and set it to: {article.field.NAME} where NAME is the Custom Field > Name.
Using PHP
To populate a form field with a custom field value of an article, copy the code shown below and place it into the PHP Scripts → Form Prepare area of your form.
// Enter the Custom Field Name (not Label) to find its value
$customFieldName = 'name';
// Enter the Hidden Field Name here to save the value
$hiddenFieldName = 'myHiddenFieldName';
// Optionally set the article's ID. Don't touch it to load current article.
$articleID = $app→input→get('id');
// Do not edit below
// Ensure article exists
$query = $db→getQuery(true);
$query→select('*')→from('#__content')→where('id=' . $db→q($articleID));
$db→setQuery($query);
if ($db→loadObject())
{
$app = \Joomla\CMS\Factory::getApplication();
$mvcFactory = $app→bootComponent('com_content')→getMVCFactory();
$model = $mvcFactory→createModel('Article', 'Site');
$model→setState('params', $app→getParams());
$article = $model→getItem($articleID);
if (defined('nrJ4'))
{
$jcfields = Joomla\Component\Fields\Administrator\Helper\FieldsHelper::getFields('com_content.article', $article, true);
}
else
{
$jcfields = FieldsHelper::getFields('com_content.article', $article, true);
}
foreach($jcfields as $jcfield)
{
if ($jcfield→name != $customFieldName)
{
continue;
}
$form['fields'][$hiddenFieldName]['value'] = $jcfield→rawvalue;
break;
}
}