Hello Nick,
you can get the solution using a field of type 'Listbox Sql'.
In the SQL statement you can individually specify the start of the counter, static text and the counting method yourself.
The documentation describes the SQL-based fields.
SQL fields with option lists:
docs.joomla-4.visforms.vi-solutions.de/e...ds-with-option-list/
There is a forum topic that answers something very similar (unfortunately in German):
vi-solutions.de/de/support/forum/19-joom...g-eindeutige-id#8113
Examples of the 'SQL-Select-Statement' parameter on the 'Basic Options' tab of the field configuration of a 'Listbox Sql' type field would be something like the following.
Ascending number (1, 2, 3, ...):
Code:
select max(id) as value, max(id) as label from #__visforms_2 as label
A text plus an ascending number (A-10035, A-10036, ...):
Code:
select concat('A-', (select max(id) + 10000 from jx_visforms_2)) as value, concat('A-', (select max(id) + 10000 from #__visforms_2)) as label
The value in the field would then be with a largest data ID (without deleting = number of data records) of 35 in the data for the form, for example: 'A-10035'
The value increments by 1 for each new record.
You can also use an explanatory text as a label: Your unique tally band number
Explanation of the table name '#__visforms_2':
'#__' = placeholder for the concrete Joomla table name prefix
'2' = Form ID
The following parameters must also be set in the field configuration, 'Basic Options' tab:
'Preselect solitary option' = 'Yes'
'Reload on change of' = at least 1 field (list box, radio or check box)
'Hide when preselected' = 'Yes' or 'No' (if 'yes' the field is not visible in the form).
This parameter is also important in the field configuration, tab 'Advanced':
'Enforce unique values' = 'Yes'.
If another user has submitted the same form in the meantime, an error message appears and the form simply has to be submitted again unchanged.
However, the current value for the 'Listbox Sql' field has already changed/incremented/adjusted automatically.
It would still be important to inform the user about it by means of a suitable text in a suitable place.
It should be clear to him that he simply needs to submit the form again.
Kind regards, Ingmar