Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying the output of hmpoDate #155

Open
wilsond-gds opened this issue Dec 20, 2023 · 0 comments
Open

Modifying the output of hmpoDate #155

wilsond-gds opened this issue Dec 20, 2023 · 0 comments

Comments

@wilsond-gds
Copy link

wilsond-gds commented Dec 20, 2023

I’m trying to figure out if it’s possible to override or add attributes output by a call to hmpoDate, which we are using to create 3 part date entry fields. Currently the output is something like:

<input class="govuk-input govuk-date-input__input govuk-input--width-2" 
id="dateOfBirth-day" 
name="dateOfBirth-day" 
type="text" pattern="[0-9]*" inputmode="numeric" 
maxlength="2">

as part of asking for a date of birth – would it be possible to add a custom autocomplete field for each of the 3 inputs, and override the maxlength attribute, as I have experienced issues with using Voice Control adding spaces when I'm filling in a number, meaning a double digit number is sometimes transcribed as a single digit.

Ideally, it would be good to know how to write a hmpoDate call that would produce the following code:

<input class="govuk-input govuk-date-input__input govuk-input--width-2" 
id="dateOfBirth-day" 
name="dateOfBirth-day" 
type="text" pattern="[0-9]*" inputmode="numeric" 
maxlength="4" 
autocomplete="bday-day">

and so on for the three date fields. Thank you!

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

No branches or pull requests

1 participant