Skip to Content Skip to Menu

🏖 Summer has arrived! Start your summer right with our summer sale! Get 25% off professional and developer memberships with code SUMMER-2025!

Default value for Radio Buttons, again.

  • kdave321
  • kdave321
  • OFFLINE
  • Posts: 213
  • Thanks: 26
  • Karma: 2
1 week 15 hours ago - 6 days 21 hours ago #341570 by kdave321
Default value for Radio Buttons, again. was created by kdave321
So 8 years ago, the answer was no.  www.joomlapolis.com/forum/developer-members-support/236784-default-value-for-radio-buttons

I realize the new custom field I defined does not have any value set for a Yes/No field, but it's really a basic expectation that I should have Yes or No set by default. 

It doesn't work in the backend field setting to say an empty field is the default.  I can code for the field being empty or zero for the default but is there an *xml file I can edit or JavaScript I can add to a templates file, just to show the default "Yes" is selected in Profile Edit?   An autoaction triggered by Profile Edit seems excessive.

Update: I decided I could accomplish what I wanted with a single checkbox, so nevermind. I'll just leave this up in case any one else is interested.
Last edit: 6 days 21 hours ago by kdave321. Reason: Updated

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 49403
  • Thanks: 8457
  • Karma: 1465
5 days 55 minutes ago #341577 by krileon
Replied by krileon on topic Default value for Radio Buttons, again.
Technically you can just change the database column default to 1 or 0 if you wanted. The reason 0, 1, and NULL are supported is they're all 3 different states. 0 is explicitly No, 1 is explicitly Yes, and NULL is the user never saved the field. We do allow supplying a default, but only if the field is available during registration. Technically it doesn't need to be visible on registration as you can hide it with CSS. We're avoiding major changes to fields right now because we'll be moving entirely to Joomla fields sometime in CB 3.0 (this will be a feature switch so don't worry!).


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum