Try our conversational search powered by Generative AI!

minlength and maxlength properties for Text and Textarea controls in EPiServer Forms

Vote:
 

Is it possible to surface the minlength and maxlength properties for Text and Textarea controls in EPiServer Forms? This seems like an easy thing to do and should be better than trying to restrict these values using RegEx.

#197419
Edited, Oct 02, 2018 15:14
Vote:
 

I think you should create a custom element which inherit from Text/Textarea and do add minlength and maxlength properties with validation on js. See how to create custom element here https://github.com/episerver/EPiServer.Forms.Samples

#197445
Oct 03, 2018 9:56
Vote:
 

Hi there, thanks for getting back to me.

I know this is possible if I customise controls but this seems like a fundamental thing that should be supported in the default implementation. I'm sure there are lots of people who whould find, in particular, the maxlength property useful. Nothing fancy, just a straight HTML attribute with possibly the ability to specify an error message.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-maxlength

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-maxlength

#197457
Oct 03, 2018 10:56
Vote:
 

Yes, I will post a feature request so we can consider to support in some next version.

#197459
Oct 03, 2018 11:01
Vote:
 

Perfect, thanks.

#197468
Oct 03, 2018 14:57
* 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.