Skip to content

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