Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance form rendering: Radio button list #347

Closed
Tracked by #317
thekaveman opened this issue Mar 25, 2022 · 0 comments · Fixed by #345
Closed
Tracked by #317

Enhance form rendering: Radio button list #347

thekaveman opened this issue Mar 25, 2022 · 0 comments · Fixed by #345
Assignees
Labels
front-end HTML/CSS/JavaScript and Django templates

Comments

@thekaveman
Copy link
Member

thekaveman commented Mar 25, 2022

This is a follow-on to #322, to enhance how forms are rendered in the page template

@angela-tran notes:

RadioSelect in Django 3.2 renders as <li> elements. We probably don't want that? Should we add something to page.html so that we have more granular control over how radio buttons are shown? (Django docs have an example of looping over the widgets.)

image

The State Template form components has some example HTML for what might work here?

<!--Bootstrap4 Custom Radios-->
<div class="form-check">
    <input class="form-check-input" type="radio" name="flexRadioDefault" id="customRadio1">
    <label class="form-check-label" for="customRadio1">
        Toggle this custom radio
    </label>
</div>
<div class="form-check">
    <input class="form-check-input" type="radio" name="flexRadioDefault" id="customRadio2" checked="">
    <label class="form-check-label" for="customRadio2">
        Or toggle this other custom radio
    </label>
</div>

The comment indicates this is just Bootstrap 4 radios?

@angela-tran suggests:

Rendering the selection_label_description may involve adding some HTML to the display value in our choices tuple. My first step would be to try out the approach in https://stackoverflow.com/questions/2204696/setting-help-text-for-each-choice-in-a-radioselect.

image

@thekaveman thekaveman added this to the Courtesy Cards milestone Mar 25, 2022
@thekaveman thekaveman moved this to In Progress in Digital Services Mar 25, 2022
@angela-tran angela-tran moved this from In Progress to PR Open in Digital Services Mar 31, 2022
@thekaveman thekaveman added templates front-end HTML/CSS/JavaScript and Django templates labels Mar 31, 2022
Repository owner moved this from PR Open to Done in Digital Services Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end HTML/CSS/JavaScript and Django templates
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants