struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [03/22] git commit: Adds usage of new urlRegex field in client side validation
Date Fri, 21 Mar 2014 20:15:42 GMT
Adds usage of new urlRegex field in client side validation


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/3f6ce657
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/3f6ce657
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/3f6ce657

Branch: refs/heads/feature/use-js-to-support-multiple-buttons
Commit: 3f6ce657da3ac6c133939bfcebb4e4e5f6bd2bc1
Parents: 3457a65
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Sun Mar 9 21:02:27 2014 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Sun Mar 9 21:02:27 2014 +0100

----------------------------------------------------------------------
 core/src/main/resources/template/xhtml/form-close-validate.ftl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/3f6ce657/core/src/main/resources/template/xhtml/form-close-validate.ftl
----------------------------------------------------------------------
diff --git a/core/src/main/resources/template/xhtml/form-close-validate.ftl b/core/src/main/resources/template/xhtml/form-close-validate.ftl
index 81a17e1..f129156 100644
--- a/core/src/main/resources/template/xhtml/form-close-validate.ftl
+++ b/core/src/main/resources/template/xhtml/form-close-validate.ftl
@@ -120,7 +120,7 @@ END SNIPPET: supported-validators
                 <#if validator.shortCircuit>continueValidation = false;</#if>
             }
             <#elseif validator.validatorType = "url">
-            if (continueValidation && fieldValue != null && fieldValue.length
> 0 && fieldValue.match("${validator.regex?js_string}")==null) {
+            if (continueValidation && fieldValue != null && fieldValue.length
> 0 && fieldValue.match("/${validator.urlRegex?js_string}/i")==null) {
                 addError(field, error);
                 errors = true;
                 <#if validator.shortCircuit>continueValidation = false;</#if>


Mime
View raw message