Skip to content

Checkbox.checked doesn't always return the expected result #10731

@jimchamp

Description

@jimchamp

Problem

The Checkbox.checked property always returns False if no value is set on the Checkbox, even if the associated checkbox was checked.

However, if a value is set on a Checkbox, it returns True even if the checkbox is unchecked.

Reproducing the bug

Will likely require a debugger

  1. Go to the /account/create page
  2. Tick the checkbox to sign up for IA newsletters
  3. Submit the form
  4. Inspect the value of the ia_newsletter Checkbox's checked property
  • Expected behavior: checked is True
  • Actual behavior: checked is False

Context

  • Browser (Chrome, Safari, Firefox, etc): Any
  • OS (Windows, Mac, etc): Any
  • Logged in (Y/N): No
  • Environment (prod, dev, local): prod

Breakdown

These Python Checkbox objects are only used by the account registration form, and I don't think that we have any plans to use any of our custom Python form Input objects in any other code paths. Let's remove the Checkbox definition and update the account registration template with HTML for the checkboxes.

Requirements Checklist

Related files

Stakeholders


Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

Metadata

Metadata

Assignees

Labels

Lead: @jimchampIssues overseen by Jim (Front-end Lead, BookNotes) [managed]Needs: HelpIssues, typically substantial ones, that need a dedicated developer to take them on. [managed]Needs: ResponseIssues which require feedback from leadPriority: 4An issue, but should be worked on when no other pressing work can be done. [managed]Type: BugSomething isn't working. [managed]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions