Is there a way to use a validation (preferly regex validation) on a tag data type? I put a validation regex in my document type where the tag data type is used but umbraco is completetly ignoring my regular expression.
I'm trying to force user to not use special charactars as tag. My regex is: ^[a-zA-z0-9]+$
Hi. Actually a validation expression is a sort of in-built metadata of a document property itself. It's available for setting and editing notwithstanding if it's relevant for particular datatype or not. Technically it works only when a datatype editor for the datatype has a property marked through 'ValidationProperty' attribute. Since a tag data editor doesn't meet this requirements setting a validation expression for it doesn't work. The only way to have a tag ditor with validation that you need that I can think of is to develop a custom data editor for this purposes - I suppose there would be not much work to do (just to copy the code of an existing tag editor and modify it a bit to add validation), though it will require some asp.net programming. You can also look for some ready to use 3d party datatypes for it, although I'm not aware of those.
Validation on Tag Data Type
Hi all
Is there a way to use a validation (preferly regex validation) on a tag data type? I put a validation regex in my document type where the tag data type is used but umbraco is completetly ignoring my regular expression.
I'm trying to force user to not use special charactars as tag. My regex is: ^[a-zA-z0-9]+$
Anyhelp would be greatky appreciated!
Thijs
Hi. Actually a validation expression is a sort of in-built metadata of a document property itself. It's available for setting and editing notwithstanding if it's relevant for particular datatype or not. Technically it works only when a datatype editor for the datatype has a property marked through 'ValidationProperty' attribute. Since a tag data editor doesn't meet this requirements setting a validation expression for it doesn't work. The only way to have a tag ditor with validation that you need that I can think of is to develop a custom data editor for this purposes - I suppose there would be not much work to do (just to copy the code of an existing tag editor and modify it a bit to add validation), though it will require some asp.net programming. You can also look for some ready to use 3d party datatypes for it, although I'm not aware of those.
Oh didn't knew that :) Thank you very much for your anwser! I'll go try that.
Thijs
is working on a reply...