Why is option 0 automatically preselected in a radio button field?

The value 0 is interpreted internally by Aivie or Mautic as “empty”, 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:

Aivie form: Radio button group with preselected value

Result: The option “0” is always preselected.

Cause

The value 0 is treated internally as a ‘empty value‘. This means:

  • 0 is interpreted similarly to null or “no value”
  • As a result, the system assumes that no value is set
  • At the same time, the first option is displayed as the default

This behavior occurs only with the numeric value 0.

If you use a string instead (e.g., "test"), everything works correctly.

Solution (Workarounds)

Option 1: Don’t use numeric value 0

Use a text value instead of 0:

  • Label = 0
  • Value = zero

or directly:

  • Label: “No”
  • Value: “0 points”

Option 2: Define a neutral default value

Add an additional option:

  • “Please select”
  • “N/A”

and set this as the first entry.

Option 3: Set the default value to something that doesn’t exist

You can also configure the field so that the default is not ’empty’ but something else, such as

  • Not selected
  • N/A

Status

This behavior is known and has been reported as a bug:

https://github.com/mautic/mautic/issues/15966

A fix is planned. However, one of the above workarounds should be used until the ticket is resolved.

Summary

The value 0 is treated internally as “empty” and is therefore automatically preselected. Use a text value instead or add a neutral selection option to work around the problem.

Für dich da.

Wir bieten dir lokalen Support und Services.

  • Wir unterstützen dich
  • Kostenloser Support per FAQ, Chat oder E-Mail. VIP Support per Video Telefonie.
  • Umgehende Support-Rückmeldung
aivie marketing automatin lokaler support adrian schimpf