I am currently using Struts 1.1 which means I am gonna have to stick with requiredif instead of validwhen. I tried using the requiredif but to no success. I dont know if its the validator that I have below that is causing the problem. This is the validator I got off the internet. Is there a way someone can provide me with the complete validation check for requiredif validator.
<validator name="requiredif" classname="org.apache.struts.util.StrutsValidator" method="validateRequiredIf" methodParams="java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest" msg="errors.required"> </validator> Also when I use the mask, it displays a syntax error. Without the depends="mask", it works but without performing the requiredif check. <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>allen</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>allen</var-value> </var> </field> Can someone kindly point out if I am missing something? Can I use mask along with requiredif? Thanks, CK. Andy Schmidgall <[EMAIL PROTECTED]> wrote: http://jakarta.apache.org/struts/userGuide/dev_validator.html :) -Andy -----Original Message----- From: Clark Kent [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 3:02 PM To: Struts Users Mailing List Subject: RE: Conditional check for depends clause in Validation.xml How do I use requiredif or validatewhen? Do you have any examples that I can use Udaya. Thanks, CK Udaya Allu wrote: use requiredif or validatewhen in the place of required -----Original Message----- From: Clark Kent [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 3:59 PM To: usergroup Subject: Conditional check for depends clause in Validation.xml I have a scenario where I have 2 textboxes in a form and I need to have the user enter either one of the fields but not both. Is there a way that we can provide conditional checks within the depends clause? Thanks, CK. --------------------------------- Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing