Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

JQuery in AA fails to update text field

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
7 months 2 weeks ago #338040 by krileon
Replied by krileon on topic JQuery in AA fails to update text field
Do you need the count actually stored in the database or do you just need it for display somewhere?

If it doesn't need to be sored there's ways of getting the count without having to use JavaScript here (mainly using CB Code Field and some PHP) and since it's not being displayed to them there isn't much point updating it with JavaScript. If it does need to be stored that can be done using CB Auto Actions and a Field action to more securely store it.

Where you're intending to display the count would also be useful since the custom display parameters in CB Field Groups allows you to output the row count already.


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.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
7 months 2 weeks ago #338052 by galanopd
Replied by galanopd on topic JQuery in AA fails to update text field

Do you need the count actually stored in the database or do you just need it for display somewhere?

I simply require it to be displayed without the need for storage.

If it doesn't need to be sored there's ways of getting the count without having to use JavaScript here (mainly using CB Code Field and some PHP) and since it's not being displayed to them there isn't much point updating it with JavaScript.

If I choose to do so, will I still be able to retain the CB Code field within the hidden tab and display it on the profile view somehow?

Where you're intending to display the count would also be useful since the custom display parameters in CB Field Groups allows you to output the row count already.

Not sure if this solution applies here, as I only require the count to be displayed in one section of the profile, while I need the rows of the CB Field Group to be displayed in another. So what I need is to pass the count to a text field (or a code field to get it) in order to display it where I need, while keeping the Field Group Rows visible elsewhere.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
7 months 2 weeks ago #338053 by krileon
Replied by krileon on topic JQuery in AA fails to update text field
Ok, if you don't need it for storage then you can do this entirely with PHP in a code field. You'd just decode the JSON data and count the rows. Example as follows.
Code:
$fieldGroup = $user->getRaw( 'FIELD_NAME_HERE', '' ); if ( ! $fieldGroup ) { return 0; } return count( json_decode( $fieldGroup, true ) );

Replace FIELD_NAME_HERE with the name of your field group field. Yes, you can hide this from profile edit entirely as it has no relevance there. If you need more control like counting a specific field inside of each row having a value you can loop the decoded JSON data and establish a count from it.


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

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

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
7 months 2 weeks ago - 7 months 2 weeks ago #338082 by galanopd
Replied by galanopd on topic JQuery in AA fails to update text field
I appreciate it, it worked fine.

Thanks
Last edit: 7 months 2 weeks ago by galanopd.

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

Moderators: beatnantkrileon
Powered by Kunena Forum