<div id="div_id_message" class="field-wrapper mb-3">
<label for="id_message" class="label-class block text-gray-900 text-sm mb-2">
Message<span class="asteriskField">*</span>
</label>
<textarea name="message" cols="40" rows="5" data-controller="textarea_autogrow" class=" bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700" required id="id_message"
></textarea>
</div>
def autogrow_textarea(self, **kwargs):
class TestForm(forms.Form):
message = forms.CharField(
widget=HammerTextAreaWidget(),
)
form = TestForm()
template = Template(
"""
{% load formify %}
{% render_field form.message %}
""",
)
return template.render(Context({"form": form}))