RequiredIf Example
Can someone post the necessary code to show a working requiredif validation. I can seem to get this going per my prior post (attached). Hello all, I have a field that I wish to validate based on the results of another field. The other field 'useSecure' returns a string of true or false from 2 radio buttons. I wish to validate a field called 'sslKeyStore' if useSecure = true. If it returns false no validation. I have tried the following... but it still gets called. field property=sslKeyStore depends=requiredif,exists arg0 key=appserver.sslkeystore.displayname/ var var-namefield/var-name var-valueuseSecure/var-value /var var var-namefield-test/var-name var-valueEQUAL/var-value /var var var-namefield-value/var-name var-valuetrue/var-value /var /field I have also tried the following... field property=sslKeyStore depends=requiredif,exists arg0 key=appserver.sslkeystore.displayname/ var var-namefield[0]/var-name var-valueuseSecure/var-value /var var var-namefield-test[0]/var-name var-valueEQUAL/var-value /var var var-namefield-value[0]/var-name var-valuetrue/var-value /var /field I am unclear as to what field-indexed means, so I tried it to, with same results as above. Any ideas why this isnt working? Thanks! Jeremy Weber [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Jeremy Weber [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validator requiredIf
Has anyone had any success validating conditionally with requiredIf client-side? There does not seem to have been a javascript method created for this validation method. I looked in 1.1B and the most recent nightly build. Also haven't had success validating server side (although I do have the source for the method in the FieldChecks class). At a minimum can anyone point to clear documentation for implementing this validation? Most of the examples I've seen seem to only deal only with indexed properties/fields -- which I'm not using. Any help or insight welcomed! Thanks, Michelle -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator requiredIf
Michelle Wynn wrote: Has anyone had any success validating conditionally with requiredIf client-side? There does not seem to have been a javascript method created for this validation method. I looked in 1.1B and the most recent nightly build. Also haven't had success validating server side (although I do have the source for the method in the FieldChecks class). Have you updated your project with the validator-rules.xml file from the nightly build, besides updating all the other associated commeons-xxx.jar files? -Rob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Validator requiredIf
Requiredif doesn't implement client-side validation, to my mind it would be too hard to come up with a mechanism to generate Javascript for the fairly complex cases you can generate using it. If someone wants to take a crack at writing it, feel free. James -Original Message- From: Michelle Wynn [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 10:58 PM To: Struts Users Mailing List Subject: Validator requiredIf Has anyone had any success validating conditionally with requiredIf client-side? There does not seem to have been a javascript method created for this validation method. I looked in 1.1B and the most recent nightly build. Also haven't had success validating server side (although I do have the source for the method in the FieldChecks class). At a minimum can anyone point to clear documentation for implementing this validation? Most of the examples I've seen seem to only deal only with indexed properties/fields -- which I'm not using. Any help or insight welcomed! Thanks, Michelle -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help validator requiredif
Ok, I've been struggling with this for a couple of hours now, tried lots of the resources online and am struggling to understand those too, hoping someone can give quickly put me on track. I've got a form, in that form there is a selector called settleType, the settleType has several valid values, Standard, Relative and Actual. The settleType is required, but the absoluteSettle (another field on that form, a text box) is only required if settleType = 'Actual'. I put something like this in my validator.xml and it generates all the other test fine, but not the requiredif check. BTW I'd also like to perform a check on absoluteSettle to ensure that (if it is required) it is a date, would putting depends=requiredif, date (with appropriate date related vars in place) work? field property=settleType depends=required arg0 key=text.tradeentry.date.settleType.label / /field field property=absoluteSettle depends=requiredif indexedListProperty=dependents arg0 key=text.tradeentry.date.absoluteSettle.label/ var var-namefield[0]/var-name var-valuesettleType/var-value /var var var-namefield-indexed[0]/var-name var-valuetrue/var-value /var var var-namefield-test[0]/var-name var-valueEQUAL/var-value /var var var-namefield-value[0]/var-name var-valueActual/var-value /var /field Thanks for any help Gary -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help validator requiredif
-Original Message- From: Frost, Gary [IT] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 1:08 AM To: '[EMAIL PROTECTED]' Subject: Help validator requiredif Ok, the requiredif check. BTW I'd also like to perform a check on absoluteSettle to ensure that (if it is required) it is a date, would putting depends=requiredif, date (with appropriate date related vars in place) work? Yep. The thing that strikes me about the code below is that you have field-indexed set to true. Are both absoluteSettle and settleType properties of an indexed field called dependents? Also, is the value returned for settleType equal to the string Actual? If so, this should be working. James field property=settleType depends=required arg0 key=text.tradeentry.date.settleType.label / /field field property=absoluteSettle depends=requiredif indexedListProperty=dependents arg0 key=text.tradeentry.date.absoluteSettle.label/ var var-namefield[0]/var-name var-valuesettleType/var-value /var var var-namefield-indexed[0]/var-name var-valuetrue/var-value /var var var-namefield-test[0]/var-name var-valueEQUAL/var-value /var var var-namefield-value[0]/var-name var-valueActual/var-value /var /field Thanks for any help Gary -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]