Code dropdown field with 'update on'

6 months 4 weeks ago #303194 by sylvain.ruda
Hi,

I need to update a field when another is modified.
This field search an xml file and give a result to populate himsefl.
How can i get the value choosen in the first field to search in the code of the second one ?
6 months 4 weeks ago #303202 by krileon
Ensure CB Core Fields Ajax field is installed then within your code field under Integrations > CB Core Fields Ajax set it to Update On against your Text field. Now just use your text field within your Code field as a substitution (e.g. [cb_myfield]) or by accessing the $user object directly (e.g. $user->cb_myfield).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
6 months 3 weeks ago #303222 by sylvain.ruda
Thank you very much !

So if i understand, if i put "cb_list_01" in "update on" field, i only had to write :

$fieldlist1 = [cb_list_01];

To put the selected value of the field cb_list_01in the var $fieldlist1 ? is that right ?
6 months 3 weeks ago #303223 by sylvain.ruda
Ok, i understand my mistake, it was $fieldlist1 = "[cb_list_01]"; with the double quotes.
Now i have a second question : I have 3 list fields. The first need to populate the second and the second populate the third.
If i had already choose a value in the first and second (so the third is populated too) and now i modify the first, The second is modified too but not the third. The "change" event seems not to be fired when the second field is modified by the first so the third one is not modified... How to to this ?
6 months 3 weeks ago #303225 by krileon
You can't chain them like that. An Update On usage won't fire any change events. Setup your fields as follows.

Field 1
Field 2 - Update On: Field 1
Field 3 - Update On: Field 1 and Field 2

That should ensure everything updates fine.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.375 seconds
Facebook Twitter Google LinkedIn