behavior: radio

behavior: radio

Standard radio button implementation. Can be applied to any group of elements having the same name to achieve one-of-group checked functionality.

Elements

that have this behavior applied by default:

  • <input type="radio"> – standard HTML inline radio button;
  • <button type="radio"> – inline radio button, use it as <button|radio(group)>first</button> <button|radio(group)>second</button>.

Attributes

that this behavior knows about:

  • checked – if provided will initialize value of runtime state of the flag checked.
  • name="groupname" – standard attribute name has special meaning for the radio: radio buttons with the same name constitute single group.
  • value="..." – standard value attribute (used by behavior:form).

Events

Aside of standard set of events (mouse, keyboard, focus) behavior:radio generates:

    BUTTON_STATE_CHANGED event – the button just changed its state to checked. Asynchronous event.BUTTON_PRESS event – mouse down or spacebar key down when button is in focus. Synchronous event.

Value

true/false, reflects current status of :checked state flag.

Note: behavior:form treats all radio radio elements of the group as a single value.