Answers.Body: <p>Yes there is a bug here with it not having a 'no default' option. from memory you can do something like this. switch to static, untick the option that is beahving as 'default', save, then re-edit, set back to dynamic and resave. does that work for you?</p>
  <p>Other things that may work depending on the component type</p>
  <p>Open 'source' and in the YAML find in the relevant component</p>
  <pre><code>    '#default_option': '0'
      '#default_value': '0'
  </code></pre>
  <p>and delete them.</p>
  <p>If it is a listbox then it will just show the first in the list UNLESS you type something into the ‘Empty option label’ field in the component/element. eg type -SELECT-</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-30T07:00:55.837Z
Answers.Text: unfortunately I tried this and it is not working.  There is no default value selected when set to either static or dynamic.  If you have any more ideas of how to get this to work I would appreciate it.  Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-30T20:49:58.083Z
Answers.Text: so you tried disabling Mrs. and then resaving, and then setting back to Dynamic and resaving again?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-06T01:55:13.110Z
Answers.Text: yet I did.  I just tried it again right now too.
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-21T04:14:42.763Z
Answers.Text: A listbox will just show the first in the list UNLESS you type something into the ‘Empty option label’ field in the component/element. eg type -SELECT-
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-05T16:47:43.873Z
Answers.Text: I have just come across a similar and infuriating issue - I have two Yes/No radios.  One I can set to no default value and it works fine i.e.  default_option: '' and the other one, despite having exaclty the same, defaults to 'No'... I've tried everything to change this but it keeps being reset to No...
Answers.UserDisplayName: ChumKui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-05T17:36:32.757Z
Answers.Text: I may have spoken too soon - in trying to understand and reproduce this, I amended the 'working' one and now cannot get either of the radio fields to default to unchecked... something seems to be resetting them to a default of 0
Answers.UserDisplayName: ChumKui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-06T19:42:32.403Z
Answers.Text: maybe this? https://github.com/colemanw/webform_civicrm/pull/686
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-28T20:49:24.427Z
Answers.LastActivityDate: 2021-07-21T04:16:20.260Z
Answers.LastEditDate: 2021-07-21T04:16:20.260Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>I have a couple CiviCRM Options fields on a Drupal 9 Webform. I want to make it so there is no default value.  There is an option to choose the default but I have not selected one.</p>
  <p><a href="https://i.sstatic.net/2LFEt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2LFEt.png" alt="enter image description here" /></a></p>
  <p>The Prefix field shows Mrs. as a default.  I added a membership type for the membership field that has the same problem but this is messy. That option will not work with the prefix because we do not want to have a prefix to ignore when doing mailings.</p>
  <p>Any ideas of how to get around this is greatly appreciated.</p>
  <p>Thanks,</p>
  <p>Steve</p>
  
Tags: <webform-civicrm><drupal-9>
Title: No Default With Webform CiviCRM Options Field
ThreadText: # No Default With Webform CiviCRM Options Field
  
  (Asked by: username_0 on 2021-06-28)
  
  I have a couple CiviCRM Options fields on a Drupal 9 Webform. I want to make it so there is no default value. There is an option to choose the default but I have not selected one.
  
  [![enter image description here](https://i.sstatic.net/2LFEt.png)](https://i.sstatic.net/2LFEt.png)
  
  The Prefix field shows Mrs. as a default. I added a membership type for the membership field that has the same problem but this is messy. That option will not work with the prefix because we do not want to have a prefix to ignore when doing mailings.
  
  Any ideas of how to get around this is greatly appreciated.
  
  Thanks,
  
  username_0
  
  **Tags:** webform-civicrm, drupal-9
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-06-28. Score: 1
  
  Yes there is a bug here with it not having a 'no default' option. from memory you can do something like this. switch to static, untick the option that is beahving as 'default', save, then re-edit, set back to dynamic and resave. does that work for you?
  Other things that may work depending on the component type
  Open 'source' and in the YAML find in the relevant component
      '#default_option': '0'
      '#default_value': '0'
  
  and delete them.
  If it is a listbox then it will just show the first in the list UNLESS you type something into the ‘Empty option label’ field in the component/element. eg type -SELECT-
  
  > **Comments:**
  > **username_2**: unfortunately I tried this and it is not working.  There is no default value selected when set to either static or dynamic.  If you have any more ideas of how to get this to work I would appreciate it.  Thanks!  
  > **username_1**: so you tried disabling Mrs. and then resaving, and then setting back to Dynamic and resaving again?  
  > **username_2**: yet I did.  I just tried it again right now too.  
  > **username_1**: A listbox will just show the first in the list UNLESS you type something into the ‘Empty option label’ field in the component/element. eg type -SELECT-  
  > **username_3**: I have just come across a similar and infuriating issue - I have two Yes/No radios.  One I can set to no default value and it works fine i.e.  default_option: '' and the other one, despite having exaclty the same, defaults to 'No'... I've tried everything to change this but it keeps being reset to No...  
  > **username_3**: I may have spoken too soon - in trying to understand and reproduce this, I amended the 'working' one and now cannot get either of the radio fields to default to unchecked... something seems to be resetting them to a default of 0  
  > **username_1**: maybe this? https://github.com/colemanw/webform_civicrm/pull/686  
  
  ---
  
  