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?

creating single unique values in hidden field

More
9 years 4 months ago #1817 by Thinamani
Hi There,

I have been trying to create a hidden text field in my form with unique ID. I am trying to get the unique ID to generate a single value digit. But once I create the field and submit the data. I query the mysql data to find out what the unique value is that has been generated and I get th following numbers as unique value: 55a232736c3a31.11707040

The generated random number seems to be too long. I would like the form to generate either a single digit value or at max 4 digits.

Any help in this matter would be greatful.

Kind Regards
Pavetiran

More
9 years 4 months ago #1821 by Administrator AV
Replied by Administrator AV on topic creating single unique values in hidden field
Hi,

the unique value is designed to be unique over a large amount of record sets. That is, why it is so long. It is created with php function uniqid();

What is the purpose of the 1 to maximum 4 digits which you want to put into the hidden fields?

Regards,
Aicha

: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 :-).

More
9 years 4 months ago - 9 years 4 months ago #1824 by Thinamani
Replied by Thinamani on topic creating single unique values in hidden field
Hi Thanks for the reply,

I am trying to use the unique ID as a search functionality which I have created using a custom PHP which connects to jos_visforms_1 and gets a record based on the unique ID entered in the search field.

If the unique ID is too long users will have issues trying to search records as they will have too many digits or characters to type in.
Last edit: 9 years 4 months ago by Thinamani.

More
9 years 4 months ago #1826 by Administrator AV
Replied by Administrator AV on topic creating single unique values in hidden field
Hi,

although I do not really understand, why you need a number for searching the record sets and why you cannot just use a text field with some "easy to remember" input like your name or something like that to search after, I think you could customize Visforms for this purpose.

You could add some Javascript (to Visforms in an template override, or to your template itself but in a way that it is only added, when the form is displayed) which sets the default value of the hidden field to a unique number of the required length. All fields do have id-attributes, so it is easy to manipulate them with javascript.

Regards,
Aicha

: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: Thinamani

More
9 years 4 months ago #1827 by Thinamani
Replied by Thinamani on topic creating single unique values in hidden field
Excellent thank you for your help!
Much appreciated. :)

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum