Skip to content

unchecked-value behavior unclear #4089

Closed
@lsmith77

Description

@lsmith77

Describe the bug

By default a checkbox is only submitted in the form when its checked and then it sends the given value. I expected the unchecked-value setting to then dynamically the value but always send the checkbox as if it as checked.

Steps to reproduce the bug

<b-form-checkbox
    v-else
    switch
    v-model="checked"
    value="1"
    unchecked-value="0"
    name="mycheckbox"
>
    foo
</b-form-checkbox>

Expected behavior

mycheckbox is either 0 (unchecked) or 1 (checked) after submission

Actual behavior

mycheckbox is 1 (checked) after submission or not set at all (unchecked)

Versions

Libraries:

  • BootstrapVue: 2.0.0
  • Bootstrap: 4.3.1
  • Vue: 2.6.10

Environment:

  • Device: Laptop
  • OS: Linux
  • Browser: Brave
  • Version: [e.g. 70]

Demo link

Additional context

Add any other context about the bug here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions