I am trying to figure out how to make 'hidden' a property of a div in my HTML:
<div class="some-class" hidden>
<input id="field1"....... form stuff>
</div>
If I have a form set up like this:
class SomeForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(SomeForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.layout = Layout(
Div(Field('field1'), css_class="some-class"),
)
Is there a way to achieve this? I have not been able to find this information in the Crispy documentation. Currently, I am using jQuery to hide the div after the page loads, or adding a class and then hiding it with CSS. But how can I directly add the 'hidden' attribute to the div?