Skip to Content Skip to Menu

[SOLVED] At my wit's end (Code Checkbox Multi-Select)

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago - 6 years 5 months ago #304454 by bascherz
I have two Code Checkbox Multiple Selection fields defined. These are the type that present options whose display is dependent on other fields being "not empty" and Ajax updated on those other fields changing. The two fields are setup IDENTICALLY. Both fields present the 2nd option at the same time, so the Ajax part is working correctly and presumably so is the code part. When I check the 2nd option (this is the dynamic one returned from the code) on one of the two fields, it saves correctly. But the second one just WILL NOT SAVE. Everything about the two fields is identical except their names (obviously). I have the same exact setup on another site and it works fine. I am at my wit's end. Any suggestions would be appreciated. I can provide SU access to CB team members if necessary.

Edit: Since it may matter (though I doubt it since this works in the identical field), here is the field code:
Code:
$options = array(); if ( filter_var($user->cb_email2,FILTER_VALIDATE_EMAIL ) ) $options['Email #2'] = 'Email #2'; return $options;
Thanks in advance.
Bruce

Bruce S - Vienna, VA
Last edit: 6 years 5 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago #304457 by bascherz
Replied by bascherz on topic At my wit's end (Code Checkbox Multi-Select)
Well, it wasn't something I was doing. I am convinced of that. I renamed the misbehaving field and copied the identical one, giving this new field the name of the old field. It's working now, but I have no idea why the other one didn't. It was just a typical CB multi-select checkbox code field. Still baffled, but moving on.

Bruce S - Vienna, VA
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 5 months ago #304480 by krileon
Replied by krileon on topic At my wit's end (Code Checkbox Multi-Select)
Not sure why your second field wouldn't work. You could try using the below to utilizes substitutions instead of directly accessing the user object and using CBs email validation function.

Code:
$options = array(); if ( cbIsValidEmail( '[cb_email2]' ) ) { $options['Email #2'] = 'Email #2'; } return options;


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.

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
6 years 5 months ago #304486 by bascherz
Replied by bascherz on topic At my wit's end (Code Checkbox Multi-Select)
The checkboxes rendered fine. The field values wouldn't save. I even set it back to a regular multi-select checkbox field and it still wouldn't save. I ended up deleting the field and creating it from scratch by copying the near-duplicate one, setting it up exactly as it had been. After that it worked. There was just something wrong about that field.

Bruce S - Vienna, VA
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 5 months ago #304490 by krileon
Replied by krileon on topic At my wit's end (Code Checkbox Multi-Select)
That's usually due to the database column type not changing and can happen when a fields type is changed. Usually can fix it by running the database fix tools within CB > Tools.


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: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum