Rules

Secret ingredients to quality software

Edit
Info

Do you always use the html maxlength attribute on input fields to limit number of characters to the length of the field in the table?

Last updated by Tiago Araujo on 24 Aug 2016 10:04 pm (almost 5 years ago) See History

**Rule 1: ** Whenever you have a data entry page you should always use the html maxlength attribute to limit number of characters to the length of the field in the table (except for numbers).

Rule 2:  Whenever you have a situation where you are using the HTML textarea (does not have the maxlength property)

Then you need to:

  • add the JavaScript function eg. ValidateLength(control)
  • add 2 properties to every data control  eg. dataType="char" onkeyup="validateLength(this)"
Adam CoganAdam Cogan

We open source. This page is on GitHub