SQL list field that allows user entered values

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 7 months ago #99783 by Cory S
It would be great if the SQL field could also allow a user entered value, if the user didn't find the value they wanted in the returned SQL list.

For example, my events are Team based. With each registration, they provide their Team name. Sometimes they spell the team name slightly different, then I have to manually correct them so they all match.

Instead, would be great to have a dropdown list that shows all the existing Team Names that have already been entered, so the user could select the Team name. If no one from their Team has registered yet, then let them manually enter a new Team name.

Alternatively, add functionality so that if a value is chosen in the SQL list, the value can be auto-populated into another Text field.

Thanks,
Cory

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #99807 by Amat
Hi Cory,
Having this problem, it was solved by an additional field that appears if you choose "My Club is not listed", just add this new club, but then the list becomes very long and the search is tedious, if not everything scroll. Now in the backend: just type in a name or a part of the name in the field of the name, the search is done automatically. It would therefore be interesting that the search for the visitor is as easy as in the backend

Ayant ce problème, il a été résolu par un champ supplémentaire qui apparait si l 'on choisit "My club is not listed", il suffit d'ajouter ce nouveau club, mais ensuite la liste devient très longue et la recherche est fastidieuse, sinon tout faire défiler. Or dans le backend : il suffit de taper dans le champ de la liste un nom ou une partie du nom, l'affichage du nom recherché se fait automatiquement. Il serait donc intéressant que la recherche pour le visiteur soit aussi facile que dans le backend !
Amat

Please Log in or Create an account to join the conversation.

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 7 months ago #99829 by Cory S
Hi Amat,

Thanks for the suggestion, that solves the first part of the problem. But how do you take the value from the SQL field and put it in the conditional text field, that will hold the final value? I could probably write some custom code, but I'd rather not create a customization. Perhaps a plugin for a custom field, would be one way to do it.

Thanks,
Cory

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #99845 by Amat
Hi Cory S,
I replenish by copying / pasting, but as the years go by, there are very few new clubs. The difficulty is found in the consultation of the list bakend, for registration no search is possible, except by scrolling the 800 clubs ...

Je remets en place par copier/coller, mais au fur et à mesure des années, il y a très peu de nouveaux clubs. la difficulté se trouve dans la consultation de la liste bakend, pour l'inscription aucune recherche n'est possible, hormis par défilement des 800 clubs...
Amat
Attachments:
Last edit: 7 years 7 months ago by Amat.
The following user(s) said Thank You: Cory S

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago - 7 years 7 months ago #100049 by Russell Noble
Replied by Russell Noble on topic SQL list field that allows user entered values
I do something similar, have an SQL field with Team Name, the list includes an option "Add New Team". If this is selected then a conditional field allows the user to enter a new team name. After saving the the new team name is added to the eb_field_values
table, so next user that comes along has it offered by the sql.

So if my text field for entering the team name is field 21 then the SQL variable has something along the lines of:
Code:
$ELECT '-- Add Team --' as id, '-- Add Team --' as name UNION $ELECT distinct field_value as id, field_value as name FR0M #_eb_field_values WH3R3 field_id = 21 and field_value <> '-- Add Team --' 0rder by 1

It does however mean in processing later I have to check which variable to get the team name from for the registration.
Last edit: 7 years 7 months ago by Russell Noble.
The following user(s) said Thank You: Cory S

Please Log in or Create an account to join the conversation.

  • Cory S
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 6 months ago #100107 by Cory S
Thanks Amat and Russell, that is very helpful. I'll try to implement something similar.

-Cory

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc