Skip to Content Skip to Menu

[SOLVED] Data lookup validation on regsiatrtion

  • bizguy
  • bizguy
  • OFFLINE
  • Posts: 199
  • Thanks: 32
  • Karma: 5
9 years 7 months ago - 9 years 7 months ago #260795 by bizguy
During registration to my site, new members enter their Sponsor's ID [user_id]. I would like to be able to call up and display the Sponsor's ID and name so the applicant can confirm they have entered the number correctly.
How can I do this?
Last edit: 9 years 7 months ago by nant.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 7 months ago #260830 by krileon
Replied by krileon on topic Data lookup validation on regsiatrtion
CB Query Field and its Query Validation on a Text field can help with that. You'd setup the query to check _users to see if the ID exists for example and validate on successful results.


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.
The following user(s) said Thank You: bizguy

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 7 months ago #260862 by nant
The following user(s) said Thank You: bizguy

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

  • bizguy
  • bizguy
  • OFFLINE
  • Posts: 199
  • Thanks: 32
  • Karma: 5
9 years 7 months ago - 9 years 7 months ago #261702 by bizguy
Replied by bizguy on topic Data lookup validation on regsiatrtion
I ended up using the Query - drop down single select with the following Query, so that I could display the ID and Name info.
Code:
SELECT `id`, CONCAT(`user_id`, ' - ', `firstname`, ' ', `lastname`) AS `member` FROM `#__comprofiler` WHERE `approved`=1 AND `banned`=0

I then set the Options as follows:
Value - id
Label - member
Last edit: 9 years 7 months ago by bizguy. Reason: excluded banned and unapproved members from the select
The following user(s) said Thank You: nant

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

  • bizguy
  • bizguy
  • OFFLINE
  • Posts: 199
  • Thanks: 32
  • Karma: 5
9 years 6 months ago - 9 years 6 months ago #262582 by bizguy
I am looking to change the success message contents on my CB Query Field - Validation of a Text Field.
Based you your tutorial I have my Sponsor ID field correctly checking the inputed user_id against the comprofiler db using the following Query:
Code:
SELECT CONCAT( `firstname`, ' ', `lastname` ) AS `my_sponsor` FROM `#__comprofiler` WHERE `user_id`='[value]';

I would like to be able to display my_sponsor in the Success message, preferably without a hack, if possible.

Thanks.
Last edit: 9 years 6 months ago by bizguy.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago - 9 years 6 months ago #262609 by krileon
The query validation has no output of the query results like that. It's simply checking if there is results. With that said you don't need the concat at all, but to simply select their id or do a count. Preferably ID as it's indexed already and will significantly speed up the query. For example your query would be as follows.

Code:
SELECT `id` FROM `#__comprofiler` WHERE `user_id` = '[value]'

I've added a feature ticket to see about allowing this for next release as it's possible to loop the column results into substitutions.

forge.joomlapolis.com/issues/5232


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.
Last edit: 9 years 6 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum