Copied to clipboard

Flag this post as spam?

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


  • Paul Fowles 75 posts 184 karma points
    Mar 04, 2013 @ 16:01
    Paul Fowles
    0

    Adding a default regex in a custom field?

    Hi,

    From looking at http://www.nibble.be/?p=154 I've been able to create a number of field types.

    I was wondering is it possible to set the regex fields programatically and if so how?

    I've tried using the setter in bool SupportRegex but I know I'm not doing it right.

     

      public override bool SupportsRegex
            {
                get
                {
                    return true;
                }

           set{   Values = Regex r

    }          
            }

    Thanks

    Paul

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 04, 2013 @ 16:02
    Tim Geyssens
    0

    Nope you can't set that up in the custom fieldtype 

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 04, 2013 @ 16:06
    Tim Geyssens
    0

    Added it as a feature request: http://issues.umbraco.org/issue/CON-297

  • Paul Fowles 75 posts 184 karma points
    Mar 04, 2013 @ 16:10
    Paul Fowles
    0

    So there is no way to access the regex field progamatically you can just show or hide it from a user

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 04, 2013 @ 16:14
    Tim Geyssens
    0

    Yup fieldtype only controls if it supports regex (so if that option is available) 

  • Paul Fowles 75 posts 184 karma points
    Mar 04, 2013 @ 16:20
    Paul Fowles
    0

    So if supports regex is set to true I cannot put a regular expression into the additional setting via code and have to do it via contour

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies