I saw here square brackets that are used in class names:
<input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" />
What does this means ?
I saw here square brackets that are used in class names:
<input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" />
What does this means ?
Nothing. Brackets are a legal character for class names with no special meaning whatsoever.
That is most likely used by some sort of validator or validation library. The class here means that validate this field denoted by validate
keyword and then:
required
it is required feild
custom
validation type; allow only letters
length
should be between 0 to 100 chars
Well, this information is used by the jQuery validation library you posted the link to :)
In standard HTML, they have no particular meaning. It's just more text.
To the jQuery Validation plugin, they do.
There is no particular rule within a class name. In your example they are almost certainly being used by a JavaScript validation framework. This is because in HTML you can't simply add your own attributes to tags, therefore the validation framework is exploiting the fact that CSS class names can contain such characters in order to 'store' the validation rules within the class name. There won't actually be any corresponding class in the style-sheet - this is just a trick to work around the limitations of HTML.