From e0a10080b1d69eb1e701d187e6a3f571facc2731 Mon Sep 17 00:00:00 2001 From: yawka Date: Thu, 7 Nov 2013 18:39:27 +0200 Subject: [PATCH] Add UI validation for regular expression property --- .../GenericProperties/GenericProperty.ascx | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/GenericProperties/GenericProperty.ascx b/src/Umbraco.Web.UI/umbraco/controls/GenericProperties/GenericProperty.ascx index 4cdad45578..bd20a7d269 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/GenericProperties/GenericProperty.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/GenericProperties/GenericProperty.ascx @@ -25,33 +25,34 @@ Edit "" - - + + - + - + - + - + - +
+
Search for a regular expression
- +
@@ -69,4 +70,13 @@ duplicatePropertyNameAsSafeAlias('<%=tbName.ClientID%>', '<%=tbAlias.ClientID%>'); } }); + function ValidateValidation(sender, args) { + try { + var patt = new RegExp(args.Value); + args.IsValid = true; + + } catch (e) { + args.IsValid = false; + } + } \ No newline at end of file