Author: husted Date: Mon Mar 19 19:45:24 2007 New Revision: 520236 URL: http://svn.apache.org/viewvc?view=rev&rev=520236 Log: WW-1799 "StringLength validator is inconsistent client side and server side" submitted by Mads Riise Rasmussen
Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl Modified: struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl?view=diff&rev=520236&r1=520235&r2=520236 ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl Mon Mar 19 19:45:24 2007 @@ -46,8 +46,10 @@ while (value.substring(value.length-1, value.length) == ' ') value = value.substring(0, value.length-1); </#if> - if((${validator.minLength} > -1 && value.length < ${validator.minLength}) || - (${validator.maxLength} > -1 && value.length > ${validator.maxLength})) { + if(value.length > 0 && ( + (${validator.minLength} > -1 && value.length < ${validator.minLength}) || + (${validator.maxLength} > -1 && value.length > ${validator.maxLength}) + )) { addError(field, error); errors = true; }