max length validation in input field code example Example: html input max vs maxlength <input type="text" maxlength="4"/>