How to reference a registration screen field.

1 week 4 days ago #338075 by cppleal
Hello. 
In a registration form, I have a field that requests a membership number and once I validate that it exists (through AJAX),
I show an ok message.
I would like to fill in a text field with the name of said partner, but I don't know how to reference the screen field, since it has not yet been saved in the Database.
The query I use would be this:
SELECT CONCAT (firstname, ' ', lastname)  FROM #__comprofiler 
WHERE cb_num_socio =
[cb_num_socio]

Thanks

Please Log in to join the conversation.

1 week 3 days ago #338077 by krileon
Replied by krileon on topic How to reference a registration screen field.
I assume you're using CB Query Field and its Query Validation for this? It just validates. It has no functionality to fill out fields.

Can you better describe what you're trying to do exactly and where? Is this just meant to display on profile? If so I'd just use a Query Field and you can query for that information as follows.

Query:
SELECT CONCAT( `firstname`, ' ', `lastname` ) FROM `#__comprofiler` WHERE `cb_num_socio` = '[cb_num_socio]'

The above should work during registration as well if you combine it with CB Core Fields Ajax and its "Update On" feature. You'd have it "Update On" the cb_num_socio field so its display refreshes during profile edit and registration when that fields value changes.

If you need it stored in the database you have a couple of different options. You could use CB Auto Actions and a Query action to push that information into the database.

You could also use something like Query Auto Complete on a Text field to give a dropdown selection of names matching that field. Example as follows.

Integrations > CB Query Field > Auto Complete
Query Auto Complete: Enable
Query:
SELECT CONCAT( `firstname`, ' ', `lastname` ) FROM `#__comprofiler` WHERE `cb_num_socio` = '[value]'


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 to join the conversation.

1 week 3 days ago #338080 by cppleal
Replied by cppleal on topic How to reference a registration screen field.
OK, issue resolved.
Sorry for the lack of details when explaining the problem, but you understood me perfectly.
I have included the field with CB Core Fields Ajax and its "Update On" and it has worked correctly.
 

Thanks.
Attachments:
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.240 seconds

Facebook Twitter LinkedIn