Skip to Content Skip to Menu

[SOLVED] onAfterUserUpdate doesn't initiate Javascript

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
1 year 11 months ago - 1 year 11 months ago #331332 by galanopd
I am facing the following

In edit profile a user sets a value in INT_FIELD (shown only in profile edit)
Then an AA->Action Javascript (Intl.NumberFormat) changes value to currency string (console shows correctly)
Then javascript last step
Code:
$('#TEXT_FIELD').val(formatter.format([INT_FIELD]));
that works fine and sets it correctly in TEXT_FIELD (shown only in profile display) BUT only when onBeforeUserProfileEditDisplay which makes not much sense to me.
I need it to update TEXT_FIELD onAfterUserUpdate so it is shown correctly in Profile Display, but it doesn't work...
 
Last edit: 1 year 11 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: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 11 months ago #331336 by krileon
Replied by krileon on topic onAfterUserUpdate doesn't initiate Javascript
onAfterUserUpdate has no rendering so JS is never going to work there.

I need it to update TEXT_FIELD onAfterUserUpdate so it is shown correctly in Profile Display, but it doesn't work...

It should display that way when saved in profile edit when using your JS on onBeforeUserProfileEditDisplay.


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
1 year 11 months ago - 1 year 11 months ago #331342 by galanopd
Replied by galanopd on topic onAfterUserUpdate doesn't initiate Javascript
So either I do something wrong or not managing to understand the logic behind.
Example
When the user enters profile edit the TEXT_FIELD gets its value from INT_FIELD, so far, so good.
Now if the user needs to change the INT_FIELD and set a new value and then click Update profile, the TEXT_FIELD will not update to the new value.
The user has to re-enter the profile edit mode and only then the TEXT_FIELD will get the new value because only then the onBeforeUserProfileEditDisplay will run.
This way we are causing the user to enter 2 times in profile edit to save the value to the TEXT_FIELD
Last edit: 1 year 11 months ago by galanopd.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 11 months ago #331343 by krileon
Replied by krileon on topic onAfterUserUpdate doesn't initiate Javascript
You need to adjust your JS so it reformats when the user changes the value. That should solve your issue. As is your JS is just applying when profile edit is visited.


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
1 year 11 months ago - 1 year 11 months ago #331347 by galanopd
Replied by galanopd on topic onAfterUserUpdate doesn't initiate Javascript

You need to adjust your JS so it reformats when the user changes the value. That should solve your issue. As is your JS is just applying when profile edit is visited.

You were correct.
Now it is working.
Thank you
Last edit: 1 year 11 months ago by galanopd.
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