1

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

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,

Steve

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-

4
  • 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! – Josh Jun 30 at 7:00
  • so you tried disabling Mrs. and then resaving, and then setting back to Dynamic and resaving again? – petednz - fuzion Jun 30 at 20:49
  • yet I did. I just tried it again right now too. – Josh Jul 6 at 1:55
  • 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- – petednz - fuzion 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.