Hi Hernan,
        Htanx for ur input, but I am still experiencing problems
Here is my validation.xml

<form name="destinationMaintenanceForm">
            <field property="destinationRef" depends="validwhen">
                  <arg0 key="prompt.destinationRef"/>
                  <msg name="validwhen"
                    key="error.field.required"/>
                  <var>
                 <var-name>test</var-name>
                 <var-value>(buttonSelected == "find") and
((destinationRef == null) or (*this* != null))</var-value>
              </var> 
            </field>
            <field property="destinationName" depends="validwhen">
                  <arg0 key="prompt.destinationName"/>
                  <msg name="validwhen"
                    key="error.field.required"/>
                  <var>
                 <var-name>test</var-name>
                 <var-value>(buttonSelected == "find") and
((destinationRef == null) or (*this* != null))</var-value>
              </var>
            </field>
          </form>

when I enter nothing in both fields, it seems that it does not validate
since the business logic is executed...

can you point me to what could be wrong in this file? Both fields need
to be
validated if the buttonSelected is equal to find and the other field is
empty...

thanx and regards
        marco



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: 22 April 2004 15:21
To: Struts Users Mailing List
Subject: Re: Validator question

In de Struts Validator guide, under the title "Conditionally required
fields" is an example of how to do conditional requirement.
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Hope it helps
Hernan



> Hi all,
>       I need help on struts validator.
> I have a form bean with two fields,and either one
> Or the other needs to be entered.
> How can I express, in validation.xml, that I want that either
> One field or the other is required?
>
> Thanx in advance and regards
>       marco
>


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


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

Reply via email to