I'm using episerver forms 4.4.1. I would like to take away non-use validators in Text form element or make the validators unique for each type of using purpose.
For example: If that textbox using to fill a name, then it's enough to use only required as validator. But if that textbox using as fill birthday, then of course needto keep datetime as validator.
Anyone has ide how to make validators unique for each kind of textbox?
Hi, validators are enable for Element Type.
So you need V1 V2 for NameTextBox, V3 V4 for BirthTextBox, you should extend the built-in TextBox to 2 more types, then change the available for each type by declare your attribute AvailableValidatorTypes
Document is here https://world.episerver.com/documentation/developer-guides/forms/creating-form-element-with-validator/
See this one, it only have one Validator: Required
You can make it an add-on as well, I've done a similar thingie for EmailElementBlock - almost the same as TextBoxElementBlock, but then I didn't need the "Email validator".
You can find some inspiration here. It's available on nuget as well.