Peng, Meimin wrote:
Hi,
Please help.
I want to use strut's validation to validate a form field called number.
This field allows to input text, number and -.
The code bellows right now is only to validate text and number without
space.
How can I make it work with '-'?
Thanks.
<form name="NumEditForm">
<field
property="value"
depends="mask">
<msg name="mask"
key="errors.maskmsg"/>
<arg0 key="errors.maskmsg.form.num.edit.value"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z]*$</var-value>
</var>
</field>
</form>
--M
CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and
confidential. Any use, copying or dissemination of any portion of this
e-mail by or to anyone other than the intended recipient(s) is unauthorized.
If you have received this e-mail in error, please reply to sender and delete
it from your system immediately.
What about <var-value>^-?[0-9a-zA-Z]+$</var-value>
That will allow you to enter any positive or negative hexadecimal number.
If you want to allow any of the following:
a--
612-6a-3461
--bc391
you'll need to do something different.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]