Kevin Powell - CommunityKP-C
Kevin Powell - Community12mo ago
41 replies
mic

Multi-input setup for license key

I'm making an "activate license" screen with an input for the license key, the license key itself is 5 sets of 6 characters separated by dashes.

I'd like to style it as a series of inputs where each segment is written, with the dashes already built in, and focus moving between the segments as you type or delete, and a paste of the license key fills the inputs and ignores the pasted dashes. Does that make sense as a method? Should I do it in one input but style it to look like many? Is there a secret third option I'm missing? How would I even implement it?

I'm currently running with svelte but I feel like this would require some vanilla js dom manipulation
Was this page helpful?