{"id":29351,"date":"2026-03-18T11:03:37","date_gmt":"2026-03-18T09:03:37","guid":{"rendered":"https:\/\/aivie.ch\/faq\/why-is-option-0-automatically-preselected-in-a-radio-button-field\/"},"modified":"2026-03-18T12:00:52","modified_gmt":"2026-03-18T10:00:52","slug":"why-is-option-0-automatically-preselected-in-a-radio-button-field","status":"publish","type":"faq","link":"https:\/\/aivie.ch\/en\/faq\/why-is-option-0-automatically-preselected-in-a-radio-button-field\/","title":{"rendered":"Why is option 0 automatically preselected in a radio button field?"},"content":{"rendered":"\n<p>The value 0 is interpreted internally by Aivie or Mautic as &#8220;empty&#8221;, which causes this option to be automatically selected, even without a defined preselection.<\/p>\n\n<!--more-->\n\n<h2 class=\"wp-block-heading\">Problem<\/h2>\n\n<p>If you use a radio button field (radiogrp) in a form and an option has the value <code>0<\/code>, this option will be automatically preselected.<\/p>\n\n<p>This happens even when <strong>no default value is defined<\/strong>.<\/p>\n\n<p>Typical example:<\/p>\n\n<div class=\"wp-block-stackable-image stk-block-image has-text-align-left stk-block stk-c038fbc\" data-block-id=\"c038fbc\"><style>.stk-c038fbc .stk-img-wrapper{width:240px !important;}<\/style><figure><span class=\"stk-img-wrapper stk-image--shape-stretch stk--has-lightbox\"><img loading=\"lazy\" decoding=\"async\" class=\"stk-img wp-image-29339\" src=\"https:\/\/cdn.aivie.ch\/media\/wp\/2026\/03\/18105547\/aivie-form-radio-button-group-preselected-480x294.png\" width=\"480\" height=\"294\" alt=\"Aivie form: Radio button group with preselected value\" title=\"\" srcset=\"https:\/\/cdn.aivie.ch\/media\/wp\/2026\/03\/18105547\/aivie-form-radio-button-group-preselected-480x294.png 480w, https:\/\/cdn.aivie.ch\/media\/wp\/2026\/03\/18105547\/aivie-form-radio-button-group-preselected.png 572w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/span><\/figure><\/div>\n\n<p>Result: The option &#8220;0&#8221; is always preselected.<\/p>\n\n<h2 class=\"wp-block-heading\">Cause<\/h2>\n\n<p>The value <code>0<\/code> is treated internally as a &#8216;<em>empty value<\/em>&#8216;. This means:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>0<\/code>  is interpreted similarly to <code>null<\/code> or &#8220;no value&#8221;<\/li>\n\n\n\n<li>As a result, the system assumes that no value is set<\/li>\n\n\n\n<li>At the same time, the first option is displayed as the default<\/li>\n<\/ul>\n\n<p>This behavior occurs <strong>only with the numeric value 0<\/strong>.<\/p>\n\n<p>If you use a string instead (e.g., <code>\"test\"<\/code>), everything works correctly. <\/p>\n\n<h2 class=\"wp-block-heading\">Solution (Workarounds)<\/h2>\n\n<h3 class=\"wp-block-heading\">Option 1: Don&#8217;t use numeric value 0<\/h3>\n\n<p>Use a text value instead of <code>0<\/code>:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>Label = 0<\/li>\n\n\n\n<li>Value = zero<\/li>\n<\/ul>\n\n<p>or directly:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>Label: &#8220;No&#8221;<\/li>\n\n\n\n<li>Value: &#8220;0 points&#8221;<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\">Option 2: Define a neutral default value<\/h3>\n\n<p>Add an additional option:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>&#8220;Please select&#8221;<\/li>\n\n\n\n<li>&#8220;N\/A&#8221;<\/li>\n<\/ul>\n\n<p>and set this as the first entry.<\/p>\n\n<div class=\"wp-block-stackable-heading stk-block-heading stk-block-heading--v2 stk-block stk-03437a2\" id=\"option-3-setze-den-standardwert-auf-etwas-das-nicht-existiert\" data-block-id=\"03437a2\"><h3 class=\"stk-block-heading__text\">Option 3: Set the default value to something that doesn&#8217;t exist<\/h3><\/div>\n\n<p>You can also configure the field so that the default is not &#8217;empty&#8217; but something else, such as<\/p>\n\n<ul class=\"wp-block-list\">\n<li>Not selected <\/li>\n\n\n\n<li>N\/A<\/li>\n\n\n\n<li><\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">Status<\/h2>\n\n<p>This behavior is known and has been reported as a bug:<\/p>\n\n<p><a href=\"https:\/\/github.com\/mautic\/mautic\/issues\/15966\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/mautic\/mautic\/issues\/15966<\/a><\/p>\n\n<p>A fix is planned. However, one of the above workarounds should be used until the ticket is resolved.<\/p>\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n<p>The value <code>0<\/code> is treated internally as &#8220;empty&#8221; and is therefore automatically preselected. Use a text value instead or add a neutral selection option to work around the problem. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The value 0 is interpreted internally by Aivie or Mautic as &#8220;empty&#8221;, which causes this option to be automatically selected, even without a defined preselection.<\/p>\n","protected":false},"featured_media":0,"template":"","categories":[],"tags":[1662],"FaqCategories":[280],"FaqTags":[1660,1661],"class_list":["post-29351","faq","type-faq","status-publish","hentry","tag-form","FaqCategories-form","FaqTags-default-value","FaqTags-survey"],"acf":[],"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","post-thumbnail":"","aiv_480w":"","woocommerce_thumbnail":"","woocommerce_single":"","woocommerce_gallery_thumbnail":""},"post_excerpt_stackable_v2":"<p>The value 0 is interpreted internally by Aivie or Mautic as &#8220;empty&#8221;, which causes this option to be automatically selected, even without a defined preselection. Problem If you use a radio button field (radiogrp) in a form and an option has the value 0, this option will be automatically preselected. This happens even when no default value is defined. Typical example: Result: The option &#8220;0&#8221; is always preselected. Cause The value 0 is treated internally as a &#8216;empty value&#8216;. This means: 0 is interpreted similarly to null or &#8220;no value&#8221; As a result, the system assumes that no value is&hellip;<\/p>\n","category_list_v2":"Uncategorized","author_info_v2":{"name":"","url":""},"comments_num_v2":"0 comments","_links":{"self":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/29351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/types\/faq"}],"version-history":[{"count":3,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/29351\/revisions"}],"predecessor-version":[{"id":29366,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/faq\/29351\/revisions\/29366"}],"wp:attachment":[{"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/media?parent=29351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/categories?post=29351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/tags?post=29351"},{"taxonomy":"FaqCategories","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/FaqCategories?post=29351"},{"taxonomy":"FaqTags","embeddable":true,"href":"https:\/\/aivie.ch\/en\/wp-json\/wp\/v2\/FaqTags?post=29351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}