newforms
newforms copied to clipboard
Checkbox not rendering
I'm a novice backend developer tasked with making a checkbox that toggles a boolean value in the DB when checked or unchecked. The form I'm modifying uses NewForms and when trying to create this checkbox element, the label shows but the checkbox does not. When extending the form I am:
"fake_agent": forms.BooleanField({label: 'Fake Agent', required: false, widget: forms.CheckboxInput}), The JSX is:
{bfo.fake_agent.labelTag()}
{bfo.fake_agent.render()}
{console.log(bfo.fake_agent)}
{bfo.fake_agent.errorMessages()}
As far as I can tell, I'm conforming to the NewForms docs and the form elements already on the page. Like I said, the "Fake Agent" label shows but the text box widget does not and I have no idea why.