Help with limiting Form field entries

#1

The web script that I’m using has an upload Form with Title, Description, etc., fields.
I have limited the Title field by simply adding maxlength, like so:

<input id="title" maxlength="30" name="title" type="text" placeholder="" class="form-control input-md">

but, I’d also like to limit the number of tags, in the Tags field. I tried this without success:

<input id="mySingleFieldTags" max="3" name="tags" type="text" placeholder="" class="form-control input-md">

any help with limiting the number of Tags that can be entered/uploaded is appreciated.
(thanks for all the previous help)

#2

That will only limit you to 3 characters, html and the browser does not know this is a tags input, it’s just text.
You would need a pattern attribute with regex to check the number of CSVs.