Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Limit address lines to 20 characters (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertparkinson authored Jan 18, 2019
1 parent 1df2e56 commit b5172eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion macros/address.njk
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<span class="error-message">{{ t(line1Error) }}</span>
{% endif %}
<input id="{{ line1Name }}"
maxlength="20"
class="form-control form-group-compound address-line1 {% if line1Error %} form-control-error{% endif %}"
name="{{ line1Name }}"
autocomplete="address-line1"
Expand All @@ -110,6 +111,7 @@
<span class="error-message">{{ t(line2Error) }}</span>
{% endif %}
<input id="{{ line2Name }}"
maxlength="20"
class="form-control form-group-compound address-line2 {% if line2Error %} form-control-error{% endif %}"
name="{{ line2Name }}"
autocomplete="address-line2"
Expand All @@ -120,6 +122,7 @@
<span class="error-message">{{ t(line3Error) }}</span>
{% endif %}
<input id="{{ line3Name }}"
maxlength="20"
class="form-control address-line3 {% if line3Error %} form-control-error{% endif %}"
name="{{ line3Name }}"
autocomplete="address-line3"
Expand All @@ -128,7 +131,7 @@
/>
</div>
{{ textInput('Town or city', name + '[city]' if name else 'city', form, inputClass='address-town-or-city',
compound=true, autocomplete = 'address-level2') }}
compound=true, autocomplete = 'address-level2', maxLength=20) }}
{{ textInput('Postcode', name + '[postcode]' if name else 'postcode', form, inputClass='postcode form-control-1-4',
autocomplete = 'postal-code') }}
{% endmacro %}
Expand Down
4 changes: 2 additions & 2 deletions macros/form.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</div>
{% endmacro %}

{% macro textInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on') %}
{{ input(label, name, form, hint, 'text', inputClass, compound, autocomplete) }}
{% macro textInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on', maxLength) %}
{{ input(label, name, form, hint, 'text', inputClass, compound, autocomplete, maxLength=maxLength) }}
{% endmacro %}

{% macro numericInput(label, name, form, hint, inputClass='', compound=false, autocomplete='on') %}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/cmc-common-frontend",
"version": "1.53.1",
"version": "1.54.0",
"author": "HMCTS",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit b5172eb

Please sign in to comment.