Yes, it's a hack IMO as it will be hell to parse internally on long strings. I found one related question to this on SO : Is there a minlength validation attribute in HTML5? W3Schools offers free online tutorials, references and exercises in all the major languages of the web. But does the job. $"> <input type="submit"> </form> this will work for your case .. its exacly how you want it. How do you set the minimum length of an input number in HTML? It is mandatory to procure user consent prior to running these cookies on your website. In our example below, we set the minimum length of value by using the pattern and required attributes on <input> elements. It works when you try to submit the form. Required fields are marked *. Making statements based on opinion; back them up with references or personal experience. How to get values from html input array using JavaScript ? Reply to this email directly, view it on GitHub 12 2016 5:04 , "Rafael Zeffa" notifications@github.com Syntax: It returns the Input Text minLength property. . Make regular expression case insensitive in ASP.NET RegularExpressionValidator, Restrict user to input real number only in C++, Password DataAnnotation in ASP.NET MVC 3 [duplicate], Limiting the length of characters in a textbox while using Razor's Html.EditFor, What is the maximum length of html textbox, How to restrict number of characters that can be entered in HTML5 number input field on iPhone, DataAnnotations StringLength Attribute MVC. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength, https://html.com/attributes/input-maxlength/, maxlength ignored for input type="number" in Chrome, Stop requiring only one assertion per unit test: Multiple assertions are fine, Going from engineer to entrepreneur takes more than just good code (Ep. className: 'form-control form-control-sm', & Max Input validation in React - Clue Mediator