ugachaka wrote:
Hi. I am wondering is there really a validation attribute "maskif".
I one forum, i read that i just need to add the following lines to my
validation-rules and validation xml files and it will work-
<validator name="validif"
classname="validation.ValidIf"
method="validateValidIf"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.commons.validator.Validator"/>

<validator name="maskif"
classname="org.apache.struts.validator.FieldChecks"
method="validateMask"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
depends="validif"
msg="errors.invalid"/>


<field property="zipcode" depends="maskif">
<arg key="validWhenForm.lastName" />
<var>
<var-name>mask</var-name>
<var-value>^\d{5}$</var-value>
</var>
<var>
<var-name>check</var-name>
<var-value>(country=='US')</var-value>
</var>
</field>

but i DOESN'T!! :(
even more - without this attribute, everything ir working fine (mask,
requiredif, email..etc)
but when i add the  lines above to my validation.xml, the others validator
rules are not working any more! It doesn't validate not required not even
other fields.
I am already stuck in this for few days, so i smb could help!

What do your log files tell you? It sounds like you've introduced an error in your validation.xml (either a syntax error, or a semantic error such as referencing a class that doesn't exist or specifying the method signature incorrectly).

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to