J
Jax
Hi,
Since the common-validator project provides a framework to configure
client and serverside validation I was looking how to control the
maxlength property of the input tags.
After much web-digging I couldn't come up with an answer. I bothers me
that one can define
<field property="firstname" depends="required,maxlength">
<var><var-name>maxlength</var-name><var-value>50</var-value></var>
and that this can result in proper client (javascript) and server-side
validation but that one still has to write:
<html:text property="firstname" MAXLENGTH="50"/>
It should be possile to enforce this through the validator framework,
right? My first idea was to send some javascript along (e.g.
document.theForm.firstname.maxlenght = 50) but that didn't work out
very well.
I'm hoping I overlooked some documentation and that something like
this is possible, because I really liked the idea of having all
validation rules in one place. And letting the user enter too much
characters only to refuse his input after the submission while it
could've been prevented earlier seems a waste of user's time.
Regards,
Olivier
Since the common-validator project provides a framework to configure
client and serverside validation I was looking how to control the
maxlength property of the input tags.
After much web-digging I couldn't come up with an answer. I bothers me
that one can define
<field property="firstname" depends="required,maxlength">
<var><var-name>maxlength</var-name><var-value>50</var-value></var>
and that this can result in proper client (javascript) and server-side
validation but that one still has to write:
<html:text property="firstname" MAXLENGTH="50"/>
It should be possile to enforce this through the validator framework,
right? My first idea was to send some javascript along (e.g.
document.theForm.firstname.maxlenght = 50) but that didn't work out
very well.
I'm hoping I overlooked some documentation and that something like
this is possible, because I really liked the idea of having all
validation rules in one place. And letting the user enter too much
characters only to refuse his input after the submission while it
could've been prevented earlier seems a waste of user's time.
Regards,
Olivier