You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Clark Kent <kr...@yahoo.com> on 2003/12/12 18:00:32 UTC
requiredif validation challenge
I use Struts 1.1 and tried to add the patch for the requiredif validator in validator-rules.xml.
Following is the code that I added in the validation.xml for the form. The form has 2 fields and only one of them can be filled inorder to perform a search.
<field property="acctID" depends="requiredif, mask">
<arg0 key="csc.prompt.acctid"/>
<msg name="requiredif" key="errors.requiredif"/>
<var>
<var-name>field[0]</var-name>
<var-value>userID</var-value>
</var>
<var>
<var-name>field-test[0]</var-name>
<var-value>NULL</var-value>
</var>
</field>
<field property="userID" depends="requiredif, mask">
<arg0 key="csc.prompt.userid"/>
<msg name="requiredif" key="errors.requiredif"/>
<var>
<var-name>field[0]</var-name>
<var-value>acctID</var-value>
</var>
<var>
<var-name>field-test[0]</var-name>
<var-value>NULL</var-value>
</var>
</field>
It seems like inspite of the above, it still doesnt seem to validate requiredif validator and proceeds with the submit anyway. Can someone guide me?
Clark
---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing