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

Add ability to specify the form for radio input #304

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

paulchubatyy
Copy link
Contributor

Form inputs may be associated with different forms. It allows creating "forms within forms".
Read a definition on HTML spec.
One can specify the form the input will be associated with like this:

    sex = forms.ChoiceField(
        widget=forms.RadioSelect(attrs={"form": "order-create-form"}),
        choices=Order.SEX_CHOICES,
        label=_("Sex"),
    )

@paulchubatyy paulchubatyy marked this pull request as ready for review June 14, 2022 01:47
Form inputs may be associated with different forms. It allows creating "forms within forms".
Read a definition on [HTML spec](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form).
One can specify the form the input will be associated with like this:

```python
    sex = forms.ChoiceField(
        widget=forms.RadioSelect(attrs={"form": "order-create-form"}),
        choices=Order.SEX_CHOICES,
        label=_("Sex"),
    )
```
@dyve
Copy link
Member

dyve commented Dec 15, 2024

After merging in main this gives errors in Python 3.13 / Django 5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants