JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The input pattern attribute</h1>
<form action="/action_page.php">
<label for="secuid">Enter ID:</label>
<input type="text" id="secuid" name="secuid" pattern="(\d{6}|\d{9})" maxlength="9" title="Enter ID"><br><br>
<input type="submit">
</form>
</body>
</html>