Move purpose attributes back to the view

This commit is contained in:
igorkorenfeld 2022-11-07 15:48:08 -05:00
parent dc9b8dac0e
commit be4527386c
No known key found for this signature in database
GPG key ID: 826947A4B867F659
2 changed files with 2 additions and 8 deletions

View file

@ -66,12 +66,7 @@ class ContactForm(forms.Form):
street_address = forms.CharField(label="Street address") street_address = forms.CharField(label="Street address")
class PurposeForm(forms.Form): class PurposeForm(forms.Form):
purpose_field = forms.CharField(label="Purpose", widget=forms.Textarea( purpose_field = forms.CharField(label="Purpose", widget=forms.Textarea())
attrs={ 'class':'usa-textarea usa-character-count__field',
'id':'with-hint',
'aria-describedby':'instructions',
'maxlength':'500',
}))
class AuthorizingOfficialForm(forms.Form): class AuthorizingOfficialForm(forms.Form):
given_name = forms.CharField(label="First name/given name") given_name = forms.CharField(label="First name/given name")

View file

@ -18,11 +18,10 @@
<div class="usa-character-count"> <div class="usa-character-count">
{{ wizard.form.purpose_field|add_label_class:"usa-label" }} {{ wizard.form.purpose_field|add_label_class:"usa-label" }}
{{ wizard.form.purpose_field}} {{ wizard.form.purpose_field|add_class:"usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=500" }}
<span class="usa-character-count__message" id="with-hint-textarea-info with-hint-textarea-hint"> You can enter up to 500 characters </span> <span class="usa-character-count__message" id="with-hint-textarea-info with-hint-textarea-hint"> You can enter up to 500 characters </span>
</div> </div>
<!-- {{ wizard.form.purpose_field|add_class:"usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=50" }} -->
</div> </div>
{% if wizard.steps.prev %} {% if wizard.steps.prev %}