Hi,
My requirement is, I have 3 fields in a
jsp and I should throw an error message if all the 3 fields are null or empty. If anyone of the field is NOT NULL, then it should NOT throw an error. I'm using
Struts 2 validation framework with validation.xml file. I need to do it as a client side validation. I tried the following code but its not working. Can anyone please send a sample code to make this run.
I tried:
<field name="searchdata.lastName">
<field-validator type="fieldexpression">
<param name="expression">
((searchdata.lastName)==null) and ((searchdata.policyNumber)==null) and ((searchdata.policyDate)==null)
</param>
<message>Enter Last Name or Policy Number or Policy Date.</message>
</field-validator>
</field>