Unique Value for List-Field

  • Ben Nia
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 6 days ago #163003 by Ben Nia
Unique Value for List-Field was created by Ben Nia
Hello,
for a racing event i want my users to choose a start number.
If the number they tiped in is already chosen, they should get an error message.

I have read the manuel. is the custom validators (Validate Field Data - Server Side) the right option?
It would be great if you have a solution with an example for me.
Maybe I'm thinking way too complicated an the solution is quite easy :)

Thanks a lot

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

More
4 months 6 days ago #163005 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Unique Value for List-Field
Hello Ben

So users will choose a value from a list of pre-defined values? How they will choose the value (from a dropdown or they will enter that value into a textbox) ?

Do you create a custom field to allow them to choose/enter that value ?

Tuan

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

  • Ben Nia
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 6 days ago #163006 by Ben Nia
Replied by Ben Nia on topic Unique Value for List-Field
Hi Tuan,
the start number is from 1 to 999 so I would prefer a text box instead a dropdown.
yes, its a custom field and I allow to enter a value.

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

More
4 months 6 days ago #163007 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Unique Value for List-Field
Hi

I just updated code of the extension to support this kind of validation. You can download latest package of Events Booking, upgrade it to your site

After that, edit the field:

- Set Server Validation Rules to unique
- Set Validation Error Message to the message you want, for example, this value is used by someone else already. Please choose a different value

Then try to check to see if it works

Regards,

Tuan

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

  • Ben Nia
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 4 days ago - 4 months 4 days ago #163049 by Ben Nia
Replied by Ben Nia on topic Unique Value for List-Field
Hi Tuan,
thank you very much for your support :-) Unfortunately I have a problem including this valiation rule. The steps I made:
- I downloaded Event booking 4.7.0 an installed it
- I modified the field for the "starting number":

is this correct?

Best regards
Last edit: 4 months 4 days ago by Ben Nia.

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

More
4 months 4 days ago #163062 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Unique Value for List-Field
Hi Ben

No, it's not correct. Just enter unique into Server Validation Settings

Regards,

Tuan

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

  • Ben Nia
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 4 days ago #163065 by Ben Nia
Replied by Ben Nia on topic Unique Value for List-Field
Hi Tuan,
thanks for your help - now it works   great job!

I have a suggestion for an improvement:
the error mesage for a not unique number pops up after sending the entire form.
it would be more user-friedly when the error message directly pops up next to the field when im typing (the same check-up procedure like an email is not correct).

illustraion for my suggestion:
  • check after sending the entire formular (unique)
 

  • user-friendly check:



Best regards
thank you for the solution :-)

Ben

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

More
4 months 4 days ago #163066 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Unique Value for List-Field
No, it is not possible. The system can only check the data from database after users submitting the form, so it will stay as how it is

Tuan
The following user(s) said Thank You: Ben Nia

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

Moderators: Tuan Pham Ngoc