Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Episerver forms custom validator never shows in UI

$
0
0

Hi. 

I am trying to create a custom validator for the latest version of Episerver forms. However, no matter what I do my validator never shows in the UI.  I have tried a few different approached with no luck.

I need to create a regex validator and I have tried the below, which when I tried it a couple of months ago on an older version of Episerver Forms, did show in the UI.

Any help here greatly appreciated.

public class PostCodeValidator : RegularExpressionValidatorBase
{
    publicoverrideIValidationModelModel
    {
        get
        {
            if(_model==null)
            {
                stringstr="^[1-9][0-9]{3}\s?[a-zA-Z]{2}$";
               _model=GetRegularExpressionValidationModel(str,str);
            }
            return_model;
        }
    }
}
Also, I am aware that I need to add values for this in the language file, but I dont see to have a lang xml at the moment. Does this need to be named anything specific or put in a specific place in the solution?
Thanks
Gary

Viewing all articles
Browse latest Browse all 9076

Trending Articles