validation max-min pattern input
How do I put 2 words minimum and 2 words maximum in an input with a pattern?
<input type="text" name="name"; pattern="()">
So this field should have 2 words mandatory and 2 words max
I don’t know if plain html allows you to do that, but with the help of javascript it can be done, here’s a related answer:
Set maximum number of words HTML textbox
To add minimum amount of words, just change the logic a little bit:
if(numWords > maxWords && numWords < minWords) { ...