Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Doubt with CB Query Field

  • Hazturuta
  • Hazturuta
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 1 week ago #235807 by Hazturuta
Doubt with CB Query Field was created by Hazturuta
Hello,

I'm going to try to explain my doubt.

I use the CB Query field plugin to show the states, through a query:

SELECT
idstate, state FROM states
ORDER BY states



But now, I need the value of the idstate selected, to do the query of the
cities of this state selected.

The query would be:

SELECT idcity, city
FROM states, cities
WHERE idstate = refstate
AND idpro = SELECTED VALUE IN THE DROP DOWN PREVIOUS
ORDER BY city

This SELECTED VALUE IN THE DROP DOWN PREVIOUS, is there any way to obtain it?

And could you give me a manual or any example, how do it?

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
11 years 6 days ago #235828 by krileon
Replied by krileon on topic Doubt with CB Query Field
The query supports substitutions. So you can use [cb_state] for example to check for the selected state. There is no ajax or dynamic reload of the fields edit display though so they'll need to change the state, save their profile, then the new values will show if using a substitution in the where statement of your query. Example as follows.

Code:
SELECT `idcity`, `city` FROM `states`, `cities` WHERE `idstate` = `refstate` AND `idpro` = '[cb_state]' ORDER BY `city`


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.

  • Hazturuta
  • Hazturuta
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 6 days ago #235832 by Hazturuta
Replied by Hazturuta on topic Doubt with CB Query Field
Hello,

1.
but, is it possible to save the registration form midway during the registration process so that the first field data is saved, but still let the user continue entering data?

2.
And there isn't another way to reload the page when you selected the state, to select the cities?

Thanks.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
11 years 6 days ago #235849 by krileon
Replied by krileon on topic Doubt with CB Query Field

1.
but, is it possible to save the registration form midway during the registration process so that the first field data is saved, but still let the user continue entering data?

No, not without ajax to save the first field or to render the second field with the first fields value passed to it. None of which is implemented.

And there isn't another way to reload the page when you selected the state, to select the cities?

No.


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.

  • Hazturuta
  • Hazturuta
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
11 years 6 days ago #235888 by Hazturuta
Replied by Hazturuta on topic Doubt with CB Query Field
Hi,

Could you give me any alternative to do this?

Thanks.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
11 years 5 days ago #235919 by krileon
Replied by krileon on topic Doubt with CB Query Field
The feature you want does not exist in CB nor do we have a plugin to provide it. The alternative is to develop a plugin to meet your needs.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum