Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thijs 97 posts 117 karma points
    Oct 21, 2011 @ 15:55
    Thijs
    0

    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

  • Rodion Novoselov 694 posts 859 karma points
    Oct 24, 2011 @ 22:43
    Rodion Novoselov
    1

    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.

  • Thijs 97 posts 117 karma points
    Oct 25, 2011 @ 12:20
    Thijs
    0

    Oh didn't knew that :) Thank you very much for your anwser! I'll go try that.

    Thijs

Please Sign in or register to post replies

Write your reply to:

Draft