You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts2SG <sa...@mubasher.net> on 2008/03/12 13:32:22 UTC
Re: Client-side validation
Hi ,
I wish that you can get some idea about this from the following link,
http://struts2issues.blogspot.com/
Struts2
Veronica Iturrioz wrote:
>
> I have a form with client side validation:
>
> <s:form validate="true" action="myAction" namespace="/"
> theme="xhtml">
>
> and an Action with some annotated validations:
>
> @Validations(
> requiredStrings = {
> @RequiredStringValidator( message = "Required", type =
> ValidatorType.FIELD, fieldName = "name", trim =
> true, key="error.required")
> ....
>
> but I get an error because of the key property. If I delete the key
> property, the client validation executes ok.
> In the package.properties I've the error.required key.
>
> How can I do this? I want to execute client-validation with key messages.
>
> I try to create a new theme, and replace form-close-validate.ftl :
> i replace the line: var error =
> "${validator.getMessage(action)?js_string}";
> for:
> <#if validator.defaultMessage?has_content>
> var error = "${validator.defaultMessage?js_string}";
> <#else>
> var error =
> "${action.getText(validator.getMessageKey())?js_string}";
> </#if>
>
> but the client validation is not executed. Some themes do not support
> client-side validation. Only useful with theme xhtml/ajax
>
> thanks in advance.
> Veronica
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
--
View this message in context: http://www.nabble.com/Client-side-validation-tp10035555p16002045.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Client-side validation
Posted by Dave Newton <ne...@yahoo.com>.
--- Struts2SG <sa...@mubasher.net> wrote:
> I wish that you can get some idea about this from the following link,
>
> http://struts2issues.blogspot.com/
If you're going to post other people's answers on your blog it would be
polite to properly attribute them. For example, I'm pretty sure "It might
have been quicker to look up the JavaDocs" was me.
I didn't see anything relating to the question being asked anyway.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org