Not a line of JavaScript — the browser blocks invalid submissions for you
pattern="[0-9]{10}"
minlength="8"
min / max
type="url"