I'm making a custom Form Element of "Date" type, so I'm extending "TextboxElementBox" like so...
public class DateElementBlock : TextboxElementBlock
{
public DateElementBlock() : base() { }
}
My custom element will be
<input type="date" />
but because I'm extending TextboxElementBlock the editor displays a few validation options...
Image may be NSFW.
Clik here to view.
which are not appropriate. I did TRY and create a custom element with a custom validator, but the client side custom error message is not displayed correctly, so I figured as the browser will ensure that the "date" field will have a proper date if it has anything in it at all, so If I could remove all the validation options above except the "Required" validator then my problem would be sorted.
I tried to override the value returned by
public override string Validators {get;set;}
inside DateElementBlock.cs
, but that only returns a list of ACTIVE validators, so it doesn't control the list of validators presented to the editors.
I think this may require a dojo solution, and I've already inspected the zip files (EPiServer.Forms.zip and EPiServer.Forms.UI.zip) and I'm hoping it works similar to adding a custom element (copy ascx/js file from zip into correct folder location).
Anyone done anything similar in the past?