Try our conversational search powered by Generative AI!

Episerver Forms custom validator

Vote:
 

I'm trying to add an Episerver Forms custom validator to my project using the RegularExpressionValidatorBase

public class MyRegExValidator : RegularExpressionValidatorBase
{
    public override IValidationModel Model
    {
        get
        {
            if (this._model == null)
            {
                string str = "...some regular expression...";
                this._model = this.GetRegularExpressionValidationModel(str, str);
            }
            return this._model;
        }
    }
}

This works fine. Validator shows in the UI, so I can select it. (also added displayname and message to the language file)

However, there is no client side validation yet. How do I register my RegEx validator to also do client side validation?

It must somehow be added to the epi.Episerver.Forms.Validators list like the other validators in EPiServerForms.js

Thanks

#144893
Feb 22, 2016 11:56
Vote:
 

I am pushing Samples source code (with full comment inline) to Episerver's Github repo. So please hold on a while. Thanks for your patience.

Thach lockevn.

#145480
Mar 04, 2016 11:05
Vote:
 

UPDATE: We open source the EPiServer Forms Samples project (contain the complexDateTimeElement) at repo https://github.com/episerver/EPiServer.Forms.Samples and https://github.com/episerver/EPiServer.Forms.Demo . We will periodically push code to them.

#145622
Mar 08, 2016 12:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.