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 

Reply via email to