You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/03/09 21:04:51 UTC

[3/4] git commit: Adds usage of new urlRegex field in client side validation

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/WW-4198-update-form-close
Commit: 3f6ce657da3ac6c133939bfcebb4e4e5f6bd2bc1
Parents: 3457a65
Author: Lukasz Lenart <lu...@apache.org>
Authored: Sun Mar 9 21:02:27 2014 +0100
Committer: Lukasz Lenart <lu...@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>