When using a Drupal Webform with CiviCRM it is possible to add a Null or 'Empty' option to a Select input box, if using a dropdown list. Is there a way to do the same thing if using radio buttons?

  • D7 or D8 as it may matter
    – petednz - fuzion
    Aug 11 '20 at 23:53
  • 1
    If the field is not marked as Required then it can be left empty. Does that do what you need?
    – Aidan
    Aug 12 '20 at 9:32

No Required Radios example:

enter image description here

Alternatively in CiviCRM -> Custom Fields -> If you wanted to specifically record the 'none' option simply add it as an Option (Add Option) and it will automatically appear on your webform as an option as well!

enter image description here

  • Null seems to be following you lately @karing-semper-it ...
    – Demerit
    Aug 12 '20 at 16:23
  • :-) :-) I know... Aug 12 '20 at 20:03
  • This is on D7. I'm dealing with the field which selects Membership Types, where it defaults to the existing value if a Membership already exists, and I wanted an option for the user to turn it off. Required doesn't affect that, and adding an 'Empty' type isn't really what's wanted. I can add a separate button and uncheck it with JavaScript, but the server still defaults to the previous value unless there is an explicit alternative set. I guess I could try adding another radio with JS which returns a value the server doesn't understand, maybe try that later. Aug 13 '20 at 1:26
  • it may help if you explain your scenario more thoroughly in your Question. eg scenario is a webform that allows for membership renewal but does not require it and the need is to prevent civi default behaviour of expecting someone to renew an existing membership
    – petednz - fuzion
    Aug 13 '20 at 20:03
  • the answer to which may be, add a field that says 'do you want to renew, add a membership or not', and then use Conditionals to set the Membership value (if that works. not tested)
    – petednz - fuzion
    Aug 13 '20 at 20:03

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.