Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Unique ID to Hidden Field

More
1 week 10 hours ago #11615 by akshehu
Unique ID to Hidden Field was created by akshehu
Hi..

I have set up the hidden field and made it generate a unique id (codes). But the codes is too long.

I want the code generated to b 4 only Pluse Initial value i may set.

How to to set this.?

Thank you
 

More
6 days 9 hours ago #11617 by Administrator IV
Replied by Administrator IV on topic Unique ID to Hidden Field
Hello akshehu,

There is no such thing as a sufficiently unique number with only 4 digits.
In this case, a simple unique counter is more appropriate.
The counter can then become too large at some point if there is too much form data.

You can generate your own unique code using SQL.
You can use all functions to calculate your counter and add additional text.

Solution:
- A field of type 'Text'.
- Protect the field against user input (A or B)
- A: Field Configuration >> 'Layout' tab >> 'Display Settings' group >> Read-Only = 'checked'.
- B: Field Configuration >> 'Layout' tab >> 'CSS Class Settings' group >> CSS Class For Control Group = 'd-none'.
- Field Configuration >> 'Basic Settings' tab >> 'Validation Settings' group >> Unique Values ​​Only = 'Yes'.
- Field Configuration >> 'Basic Settings' tab >> 'Dynamic Settings' group >> SQL Field = 'Yes'.
- Field Configuration >> 'Basic Settings' tab >> 'Dynamic Settings' group >> Field value SQL statement = 'Your SQL statement'.

Unique counter, 3 options:
A: The next free record ID can be used as a unique counter:
Code:
select max(id)

B: There is a similar example in the forum, including various SQL statements.
Auto Increment Field:
vi-solutions.de/en/forum/19-joomla-exten...increment-field#9103

C: The SQL function 'UUID()' is suitable for a limited unique number, which you can also shorten to 4 digits.
Code:
select concat('TEST', substring(uuid(), 1, 4))

Note:
During the time the form is being filled out, another user may create a new form record.
In this case, the following setting prevents the saving of an identical value: Unique Values ​​Only = 'Yes'.
If another user submits the same form in the meantime, an error message appears and the form must simply be submitted again without any changes.

The current value for the 'Text' field has already been automatically changed/incremented/adjusted.

Expanding Visforms:
We will expand the simple configurable options in Visforms.
I have created a development issue in the feature wish list:
Issue [VF-1494] Forum: Field Value or new Type: Unique number with start value and formattable counter

When we release the new feature, you will be explicitly informed about the release here in the topic.
Thank you again for your suggestion!

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: akshehu

More
6 days 8 hours ago #11618 by Administrator IV
Replied by Administrator IV on topic Unique ID to Hidden Field
Hello akshehu,

If you really just want a 4-digit random expression with a freely selectable prefix, you can simply continue using the 'hidden' field.
In this case, you also work with the 'Fill Field With' parameter:
- Field Configuration >> 'Basic Settings' tab >> 'Default Value Settings' group >> Fill Field With = 'Custom default value from SQL statement'.
- Field Configuration >> 'Basic Settings' tab >> 'Default Value Settings' group >> Default value SQL statement = 'select concat('TEST', substring(uuid(), 1, 4))'.

Where:
4 = Number of digits from the UUID.
TEST = The prefix.

Best regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
The following user(s) said Thank You: akshehu

More
3 days 11 hours ago #11623 by akshehu
Replied by akshehu on topic Unique ID to Hidden Field
Thank you very much for the detail reply. I appreciate.

I will carefully try it out and see how it work for me.

Thank you

More
2 days 20 hours ago #11625 by akshehu
Replied by akshehu on topic Unique ID to Hidden Field
I followed carefully your instruction and it worked like a charm.

Thank you so much for your support. 
The following user(s) said Thank You: Administrator IV

More
2 days 12 hours ago #11628 by Administrator IV
Replied by Administrator IV on topic Unique ID to Hidden Field
Hello akshehu,

I'm glad I could help you.
You're very welcome.

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum