Skip to Content Skip to Menu

[SOLVED] CB Query Field

  • gabryrm
  • gabryrm
  • OFFLINE
  • Posts: 8
  • Thanks: 2
  • Karma: 0
2 years 5 months ago - 2 years 5 months ago #329587 by gabryrm
[SOLVED] CB Query Field was created by gabryrm
Hi,
in my registration form I have 4 Query drop-down fields:
cb_regione (the regione has more provincie)
cb_provincia (the provincia has more città)
cb_citta (the città can have more than one cap)
cb_cap

the table where this informations are found is called comune_cap_prov_regioni and has the following structure
Id
comune
cap
prov
provincia
regione


Referring to the following example: www.joomlapolis.com/documentation/345-cb-query-field/tutorials/18533-configuring-dynamic-usa-state-city-zip-fields-with-cb-query- field-pluginIn, I entered in the query field of the region (cb_regione) with the following sql statement:
SELECT DISTINCT `regione` FROM` comune_cap_prov_regioni` ORDER BY `regione`
The cb_regione field is populated by all regions and everything is "OK".

In the other fields, I have entered the respective SQL instructions but they remain empty:
For cb_provincia:
SELECT DISTINCT `provincia` FROM` comune_cap_prov_regioni` WHERE `regione` = '[cb_regione]' ORDER BY` provincia`

For cb_citta
SELECT DISTINCT `comune` FROM` comune_cap_prov_regioni` WHERE `provincia` = '[cb_provincia]' ORDER BY` comune`

For cb_cap
SELECT DISTINCT `cap` FROM` comune_cap_prov_regioni` WHERE `comune` = '[cb_citta]' ORDER BY` cap`

Could you please help me understand what I did wrong?
Probably it is the "WHERE" condition, but I don't understand what, it is the same as the example.

A thousand thanks
Gabriella
Last edit: 2 years 5 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
2 years 5 months ago - 2 years 5 months ago #329594 by krileon
Replied by krileon on topic CB Query Field
Ensure CB Core Fields Ajax is installed and you've configured Integrations > CB Core Fields Ajax > Update On for cb_provincia, cb_citta, and cb_cap. Your query looks fine, but they're dependent on a field previous to them so they need the Update On feature to be configured so they'll refresh their display when the field they depend on changes value. So your Update On for each field should be as follows.

cb_provincia
Update On: cb_regione

cb_citta
Update On: cb_provincia

cb_cap
Update On: cb_citta

Without CB Core Fields Ajax you will have to save your profile. Go back to profile edit. Edit the next field and rinse repeat until they're all filled.


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: 2 years 5 months ago by krileon.

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

  • gabryrm
  • gabryrm
  • OFFLINE
  • Posts: 8
  • Thanks: 2
  • Karma: 0
2 years 5 months ago #329609 by gabryrm
Replied by gabryrm on topic CB Query Field
Hi,
I have purchased, installed and set up CB Core Fields Ajax and now it works very well.
A thousand thanks!
Gabriella
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum