You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian McSweeney <br...@aurium.net> on 2003/06/11 18:06:00 UTC

Help with requiredif validation

Hi all,

I'd like to use requiredif to validate some fields as follows:

on my jsp I have a checkbox, eg "supplier",

if this checkbox is checked, then I want another field, eg "name" to be required.
I've tried to set this up in my validation.xml file as follows:

              <field property="name"
                     depends="requiredif">

                  <arg0 key="validateForm.name"/>
                  <arg0
                      name="requiredif"
                      key="A name is"
                      resource="false"
                  />
                  <var>
                    <var-name>validateForm.supplier</var-name>
                    <var-value>true</var-value>
                  </var>

however it doesn't seem to be working at all.
Any ideas?
thanks,
Brian

PS - other fields are being validated correctly.