Skip to Content Skip to Menu

Check value at registration

12 years 1 month ago #210783 by andreas.hallberg
Check value at registration was created by andreas.hallberg
Hi,

I have a field where you have to fill in a unique code consisting of 12 digits (0-9) and I would like to test that the value isn't already in the database. Is it possible and in that case how do I do it the best way?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
12 years 1 month ago #210854 by krileon
Replied by krileon on topic Re: Check value at registration
Yup, using CB Database Lookup fieldtype plugin you can do exactly this. It's available for download in the Professional downloads section.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

12 years 1 month ago #210861 by andreas.hallberg
Replied by andreas.hallberg on topic Re: Check value at registration
Thanks, I will have a look on that plugin.

/A

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 6 months ago - 10 years 6 months ago #244116 by andreas.hallberg
Replied by andreas.hallberg on topic Re: Check value at registration
Hi,

Long time ago :-)

Is it possible to change the popup message from "Invalid code" to something else?

Preferably it would be a field where you specify the message in the DB Lookup field settings.

As default the DB Lookup plugin seems to fail registration when the value isn't in the database. In my case I would need to have it the way around. If the value already is in the database it will fail, like when you try to registrate the same email address twice.

I tried with "<> '[value}'" but I don't know if that's the best way to do it in sql. Any better options?

I Sweden everyone has a unique number that is mandatory in our database. I want to use the above to prevent double registrations.


BR

Andreas
Last edit: 10 years 6 months ago by andreas.hallberg.

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 6 months ago #244142 by nant
Replied by nant on topic Re: Check value at registration

andreas.hallberg wrote: Hi,

Long time ago :-)

Is it possible to change the popup message from "Invalid code" to something else?

Preferably it would be a field where you specify the message in the DB Lookup field settings.

As default the DB Lookup plugin seems to fail registration when the value isn't in the database. In my case I would need to have it the way around. If the value already is in the database it will fail, like when you try to registrate the same email address twice.

I tried with "<> '[value}'" but I don't know if that's the best way to do it in sql. Any better options?

I Sweden everyone has a unique number that is mandatory in our database. I want to use the above to prevent double registrations.


BR

Andreas


Yes, you need to adjust your dblookup query to reflect the logic you want.

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

Moderators: beatnantkrileon
Powered by Kunena Forum