Hey,
Looks great,
You can get the values out from the inputs on the form by using this.
for example for the CVC Number, you can have this event handler on the input cvcInput.addEventListener('input', inputHandlerCVC); that will listen for any inputs in the cvcInput.
you can then have a function similar to this to handle the input and update the text on the card.
const inputHandlerCVC = (event) => { sanitizeInputLength(event.target.value, cvcInput, 3); cvcOnCardBack.innerHTML = event.target.value; }
You will also wan't to probably validate it as its entered so the user cannot enter a CVC that is longer than 3 digits / check that the user hasn't removed the number tag from the input and entered text, that said its not in the spec but the more validation the better !
In reality the validation would be performed on submit to the backend and rejected if it wasn't in the right format.
Marked as helpful
@ayush111222
Posted
@SlothSan thanks so much for your help mate.