I have a page with a textbox where a user is supposed to enter a 24 character registration code. I used maxlength to limit the user to enter 24 characters.
The registration codes are typically given as groups of characters separated by dashes, but I would like for the user to enter the codes without dashes.
How can I write a JavaScript code to check that the user inputs do not contain dashes, or better yet, only contains alphanumeric characters?