JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="text" pattern="\d{9}|\d{13}">
<button type="submit">Do</button>
</form>
<form>
<input type="text" pattern="\d{9}|\d{13}">
<button type="submit">Do</button>
</form>