Hi Adam!
Hmmm .... ok, I understand the "chained validator" thing.
So, even if we go the client side converter way, I would like to have a
way to define the "allowed characters" for the input field.
Maybe by adding a method like
InputMask getInputMask()
to the ClientConverter interface. This return a regexp which we can use
to check onkeypress et al if the input is syntactically correct.
We can have this on the ClientValidator too (for validateEMail,
validateISBN etc) and always check all masks associated to the field.
A number converter will return "[0-9]*" as mask, but the ClientValidator
might be smart enough (say a range validator 100-1000) to create a
regexp like "^[0-9]{0,4}$"
The InputMask might be a structure which returns not only the regexp,
but also a human readable form of it.
So the converter will return "Numerical Input" and the validator
something like "In the range from 100 to 1000". We can put this in the
status line of the browser then to assist the user even more.
Yes, you are right that it is better to have the ClientConverter and
pass this value to the ClientValidator.
Thanks Adam for the lesson - this is why I like open-source, you will be
teached for free ;-)
Ciao,
Mario