SaaS CMS has officially launched! Learn more now.

EPiServer Forms custom validator


I'm trying to implement a custom validator for my form elements. I started following this post By Mark van Dijk. There it says that in order to get the javascript to load correctly, the following lines of code needs to be implemented:

[ServiceConfiguration(ServiceType = typeof(IViewModeExternalResources))]
public class FormsViewModeExternalResource : IViewModeExternalResources
public IEnumerable> Resources
var arrRes = new List>
new Tuple("script", 
return arrRes;

Correct me if I'm wrong, but as what I can see, the file FormsValidators.js have been removed in 3.0.0 and "baked into" EPiServerForms.js? Then when I substitute the line above with the following:


I end up with a 404.

Should I be using a different approach here or what?

Thanks in advance

/ Carl

Jul 26, 2016 15:39

Hi  Carl

I can't remember such file FormsValidators.js. We don't have that.

I have provided fully working example (and production level) code at

You can take a look at DateTimeValidator and RecapchaValidator

Hope this help.

Thach Lockevn.

Aug 01, 2016 6:37

hi Thach

How can we enable server side validation on for example textbox ? we get spam in forms, even when text field has client side email validation On.



Jan 03, 2020 11:17
* 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.