Prev | Current Page 756 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

It seems an obvious
consequence to put the validation rules in the HTML context. A rule is the definition of a constraint that
must be applied to a control. If the HTML syntax had an input of type email , it would be obvious to
understand the rule that is applied on the control and which values can satisfy it.
One way to introduce the rules in an HTML document could be using the class attribute. Classes define
groups of elements semantically related so it seems to be a good place to put the validation rules; on the
other side class is quite limited about the values that can be expressed within it. You can say that a
control can have class email , but how do you express that the control is a number with a value between
5 and 10? Defining a class for each possible combination could be a pain considering that in many cases
those rule parameters can be optional.
A possible solution is to extend the HTML. One of the nice things that all the HTML browsers have in
common is that if they do not recognize an element or an attribute, they simply ignore it.


Pages:
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768