Thanks Dave! -----Original Message----- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 11:21 AM To: Struts Users Mailing List Subject: Re: Struts Validator changing the "key" in the validator.xml
There are some examples here. http://home.earthlink.net/~dwinterfeldt/overview.html#i18n > In the Application resources properties currently I > have "{0} is invalid" > for my "errors.invalid" tag. What I would like to > have is "{0} is invalid > because {1}" but I don't know how to define the {1} > in the validation.xml > and validation-rules.xml. <field property="lastName" depends="required,mask"> <arg0 key="registrationForm.lastname.displayname"/> <arg1 name="mask" key="registrationForm.lastname.becauseMessage"/> <var> <var-name>mask</var-name> <var-value>^[a-zA-Z]*$</var-value> </var> </field> or you can override the default message: <field property="lastName" depends="required,mask"> <msg name="mask" key="registrationForm.lastname.maskmsg"/> <arg0 key="registrationForm.lastname.displayname"/> <var> <var-name>mask</var-name> <var-value>^[a-zA-Z]*$</var-value> </var> </field> David --- Ben Kafka <[EMAIL PROTECTED]> wrote: > Was wondering if there is a way to access a unique > string to display for a > "required" error in the javascript function under > validator-rules.xml. Right > now the following happens: > If in the validator.xml file I specify the <arg0 > key=regform.firstname.displayname" > it is > used by both the "required" and "mask" javascript > functions to display a > canned error like > Firstname is invalid. > Firstname required. > > How can I differentiate these. For instance I would > like to say.. > Firstname in invalid because only upper and lower > case letters are allowed. > > In the Application resources properties currently I > have "{0} is invalid" > for my "errors.invalid" tag. What I would like to > have is "{0} is invalid > because {1}" but I don't know how to define the {1} > in the validation.xml > and validation-rules.xml. > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: <mailto:[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]>