I am trying to fix the autofill on my expiry input. It should autofill the last 2 digits of YYYY. Just YY.
I feel like I’m doing this right, but when I autofill it uses the first 2 digits, not the last 2.
Where am I going wrong?
<InputField
id={id}
name={'YY'}
label={'YY'}
placeholder='YY'
maxlength="2"
pattern="d{2}"
autoComplete='cc-exp-year'
/>
2
Answers
I had some input masking effecting it.
Removed that and used this code to fix it: