Answers.Body: <p>Profile conditional ext can be used to provide this - <a href="https://civicrm.org/extensions/profile-conditionals" rel="nofollow noreferrer">https://civicrm.org/extensions/profile-conditionals</a></p>
  <p>You dont have any UI option to build the conditions. But this can be easily done in civicrm.settings.php. The config we used for select-other field is pasted below -</p>
  <ul>
  <li>custom_229 is the dropdown field wth options + other</li>
  <li>custom_230 is the &quot;Other&quot; Text field.</li>
  </ul>
  <pre><code>global $civicrm_setting;
  $select_other = [
    'onload' =&gt; [
      'selectors' =&gt; [
        '#editrow-custom_230' =&gt; [
          'display' =&gt; 'hide',
        ],
      ],
    ],
    'select-other' =&gt; [
      'conditions' =&gt; [
        'all_of' =&gt; [
          [
            'id' =&gt; 'custom_229',
            'op' =&gt; 'value_is',
            'value' =&gt; '7', //Other
          ],
        ]
      ],
      'states' =&gt; [
        'pass' =&gt; [
          'selectors' =&gt; [
            '#editrow-custom_230' =&gt; [
              'display' =&gt; 'show',
            ],
          ],
        ],
        'fail' =&gt; [
          'selectors' =&gt; [
            '#editrow-custom_230' =&gt; [
              'display' =&gt; 'hide',
            ],
            //Clear the text value if other is not selected in the dropdown
            '#custom_230' =&gt; [
              'value' =&gt; '',
            ],
          ],
        ],
      ],
    ],
  ];
  
  //Apply the above condition to contribution page id 22, 23 and 24
  $civicrm_setting['com.joineryhq.profcond']['com.joineryhq.profcond'] = [
    'contribution' =&gt; [
      22 =&gt; $select_other,
      23 =&gt; $select_other,
      24 =&gt; $select_other,
    ],
  ];
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-05T15:48:15.310Z
Answers.Text: Regarding jitendra - fuzion comments, above "You dont have any UI option to build the conditions." (Profile Conditionals Extension)... Does anyone know if there are plans to incorporate this UI functionality into Civi? We have clients that want to be able to add conditional fields in forms "on the fly", without having to come to us each time to add to civicrm.settings.php.
Answers.UserDisplayName: Jennifer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-05T19:14:24.780Z
Answers.Text: if custom_229 is a radio button, in the subject-identifier-type I think we have to use `'selector' => "[name='custom_23']:checked"` instead of `'id' => 'custom_229'`
Answers.UserDisplayName: masetto
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-20T04:00:25.793Z
Answers.LastActivityDate: 2021-04-20T04:49:10.467Z
Answers.LastEditDate: 2021-04-20T04:49:10.467Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>If you are based upon Drupal, an easy way to make something similar is to use a Webform with 2 items and a "conditionnal" : if item1 = "other" then item2 is shown</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-21T08:06:44.423Z
Answers.LastActivityDate: 2016-12-21T08:06:44.423Z
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.Body: <p>You don't have an option for entering a user value in Core Civi so you have to write a javascript to populate a field and you should read the value using POST and write to the respective table (custom field)</p>
  
  <p>You can achieve by creating a new extension with some hooks</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T16:01:42.073Z
Answers.LastActivityDate: 2015-08-04T16:01:42.073Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.Body: <p>This has been a feature request from time-to-time, and would be a great one to submit to the <a href="https://civicrm.org/paid-issue-queue">Paid Issue Queue</a>.</p>
  
  <p>If you want to DIY a solution I'd suggest you create a simple textfield as your custom field, and then use jQuery to add some extra radios that hide and populate the field unless the "other" box is selected, then show the field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-12T13:47:21.407Z
Answers.Text: If you do add this to the Paid Issue Queue please let me know as I have an interest in this subject as well.  Thanks!
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T18:37:13.917Z
Answers.LastActivityDate: 2015-08-04T18:37:13.917Z
Answers.UserDisplayName: Coleman
Body: <p>Is there a way to create a CiviCRM form like this:</p>
  
  <blockquote>
    <p>What would you like to eat at the event?</p>
    
    <ul>
    <li>Falafel</li>
    <li>Kebap</li>
    <li>Other: .........................    &lt;-- user can make a free entry here </li>
    </ul>
  </blockquote>
  
  <p>As far as I can see, multiple choice fields in CiviCRM do not provide this functionality, or am I overlooking something? Any other ideas how to achieve this (or something similar)?</p>
  
Tags: <profile><custom-fields><forms>
Title: Editable "Other" option in multiple choice / select field?
ThreadText: # Editable "Other" option in multiple choice / select field?
  
  (Asked by: username_0 on 2015-08-04)
  
  Is there a way to create a CiviCRM form like this:
  
  > What would you like to eat at the event?
  >
  > * Falafel
  > * Kebap
  > * Other: ......................... <-- user can make a free entry here
  
  As far as I can see, multiple choice fields in CiviCRM do not provide this functionality, or am I overlooking something? Any other ideas how to achieve this (or something similar)?
  
  **Tags:** profile, custom-fields, forms
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_6 on 2015-08-04. Score: 6 | Accepted answer
  
  This has been a feature request from time-to-time, and would be a great one to submit to the [Paid Issue Queue](https://civicrm.org/paid-issue-queue).
  
  If you want to DIY a solution I'd suggest you create a simple textfield as your custom field, and then use jQuery to add some extra radios that hide and populate the field unless the "other" box is selected, then show the field.
  
  > **Comments:**
  > **username_7**: If you do add this to the Paid Issue Queue please let me know as I have an interest in this subject as well.  Thanks!  
  
  ---
  
  ### Answer by username_1 on 2021-04-20. Score: 4
  
  Profile conditional ext can be used to provide this - https://civicrm.org/extensions/profile-conditionals
  You dont have any UI option to build the conditions. But this can be easily done in civicrm.settings.php. The config we used for select-other field is pasted below -
  
  custom_229 is the dropdown field wth options + other
  custom_230 is the "Other" Text field.
  
  global $civicrm_setting;
  $select_other = [
    'onload' => [
      'selectors' => [
        '#editrow-custom_230' => [
          'display' => 'hide',
        ],
      ],
    ],
    'select-other' => [
      'conditions' => [
        'all_of' => [
          [
            'id' => 'custom_229',
            'op' => 'value_is',
            'value' => '7', //Other
          ],
        ]
      ],
      'states' => [
        'pass' => [
          'selectors' => [
            '#editrow-custom_230' => [
              'display' => 'show',
            ],
          ],
        ],
        'fail' => [
          'selectors' => [
            '#editrow-custom_230' => [
              'display' => 'hide',
            ],
            //Clear the text value if other is not selected in the dropdown
            '#custom_230' => [
              'value' => '',
            ],
          ],
        ],
      ],
    ],
  ];
  
  //Apply the above condition to contribution page id 22, 23 and 24
  $civicrm_setting['com.joineryhq.profcond']['com.joineryhq.profcond'] = [
    'contribution' => [
      22 => $select_other,
      23 => $select_other,
      24 => $select_other,
    ],
  ];
  
  > **Comments:**
  > **username_2**: Regarding username_1 comments, above "You dont have any UI option to build the conditions." (Profile Conditionals Extension)... Does anyone know if there are plans to incorporate this UI functionality into Civi? We have clients that want to be able to add conditional fields in forms "on the fly", without having to come to us each time to add to civicrm.settings.php.  
  > **username_3**: if custom_229 is a radio button, in the subject-identifier-type I think we have to use `'selector' => "[name='custom_23']:checked"` instead of `'id' => 'custom_229'`  
  
  ---
  
  ### Answer by username_4 on 2016-12-21. Score: 2
  
  If you are based upon Drupal, an easy way to make something similar is to use a Webform with 2 items and a "conditionnal" : if item1 = "other" then item2 is shown
  
  
  ---
  
  ### Answer by username_5 on 2015-08-04. Score: 0
  
  You don't have an option for entering a user value in Core Civi so you have to write a javascript to populate a field and you should read the value using POST and write to the respective table (custom field)
  
  You can achieve by creating a new extension with some hooks
  
  
  ---
  
  