you can count the saved records and create the string using PHP
// Create a database object
$db = JFactory::getDbo();
// Table name
$tableName = $db->quoteName('your_table_name');
// SQL query to count records in the table
$query = $db->getQuery(true)
->select($db->quote('*'))
->from($tableName);
// Set the query for counting records
$query->select('COUNT(*) AS total');
// Execute the query
$db->setQuery($query);
try {
// Fetch the result as an associative array
$result = $db->loadAssoc();
// Extract the total count from the result
$totalCount = intval($result['total']);
// Output the total count
echo "Total records in $tableName: $totalCount";
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
Now you use the $totalCount variable to build the string, return it from the PHP action and use {var:php_action_name} in your field value
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
drag a PHP action above the Text field, insert the code and add this line at the end:
return $totalCount;
Then in your field value you should use {var:php_action_name}, replace "php_action_name" with the name of the PHP action you will drag
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
The message means that PHP action can be used on the website frontend (public area) after validation, but for testing purposes you can run your test first:
1- in admin area, verify the code is working as expected
2- Enable the trial validation in the Chronoforms validation to test it further on the frontend
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
One more very important thing: how to ensure that all text fields are impossible to edit by the user?
Currently, all text fields can be edited by the user. HTML atributes fields readonly is a good solution?
How do I clear test entries in this table? Is it enough to click EMPTY in phpmyadmin for this table and it will clear all test data and count from the beginning?
if you want to prevent editing then readonly is ok, but if this is sensitive data then you must build the data using PHP before the form is submitted.
You should TRUNCATE the table to reset the count, the feature is available in ChronoMyAdmin which can manage your Joomla database tables from the Joomla admin area
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Where in Chronoforms 8 are required fields set? Required to be completed. In previous versions of Chronoforms, I know it was more intuitive. I can't find it in the latest version of Chronoforms 8
I already found it on the Behaviors, on my small screen I have to swipe down a lot to find these functions. I'm sorry for the trouble.