Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[solved] Default value for a text field = value of an other text field

  • APerrin
  • APerrin
  • OFFLINE
  • Posts: 7
  • Thanks: 2
  • Karma: 0
6 years 5 months ago - 6 years 5 months ago #305015 by APerrin
Hello, I search but without finding an answer - I would like to set as default value for a text field the value of an other text field (if this one is not empty). I tried with CB auto action but didn't find the correct trigger .
Thanks for your help !
AP
Last edit: 6 years 5 months ago by APerrin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 5 months ago #305028 by krileon
You'd need to use CB Auto Actions for that. The below should work fine, but it only applies to new registrations.

Global
Triggers: onAfterUserRegistration
Type: Field
User: Automatic
Access: Everybody
Action
Field: YOUR_FIELD_HERE
Operator: Set
Value: [FIELD_NAME]

For YOUR_FIELD_HERE select the field you want to set the default for. For FIELD_NAME change to the field name of the field you want to be copied. You'd need to further explain what you're trying to do if you want this to apply to profile edit as well as default is normally only applied if the field is explicitly set to NULL, which in most cases it's not unless it's during registration.


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.

  • APerrin
  • APerrin
  • OFFLINE
  • Posts: 7
  • Thanks: 2
  • Karma: 0
6 years 5 months ago #305042 by APerrin
Dear Kyle,
thanks for your answer. Just to be more specific.
I have a field [LastNameOfChildren] and I would it to be set by default to the value of system field [lastname] as soon as it is modified.
It's only during registration (and not after)
and the user should be able to modify the default value of [LastNameOfChildren].

Thanks for your help !

AP

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
6 years 5 months ago #305047 by krileon
You want it to be dynamically set during registration? That's a lot more complicated. There's no functionality for that. So you need to write the necessary jQuery to copy the lastname field to the lastname of child field. You can then load that jQuery onto the registration page using a Code action with Method set to jQuery on the onBeforeRegisterFormDisplay trigger.


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.

  • APerrin
  • APerrin
  • OFFLINE
  • Posts: 7
  • Thanks: 2
  • Karma: 0
6 years 5 months ago #305056 by APerrin
OK thanks - I will try this.
Have a nice day.

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

Moderators: beatnantkrileon
Powered by Kunena Forum