Making a text input require a username then a #id

September 9th 2024 63 views • 1 comments

I'm on freecodecamp and I'm doing a survey form. For my form I want to add an input for an ID which is a username followed by a # and then six numbers. How or is there a way to make the user need to add the username then the #id

Thank you in advance!

<form> <label for="user-id">User ID:</label> <input type="text" id="user-id" name="user-id" pattern="[a-zA-Z0-9]+#[0-9]{6}" required> <small>Format: username#123456</small> <input type="submit" value="Submit"> </form>