One of the way is to override display template for this element and take control of resulting markup yourself.
I understand this is an option, but there is no away to fill this 'AttributesString'? Because when you decompile the source code, you can see that a key value pair is rendered to html properties into the ascx.
I just can't figure out where to fill these values..
Model.AttributesString is constructed based on available validators for particular form field block.
For instance by default for input field, following validators are available:
RequiredValidator RegularExpressionValidator EmailValidator DateDDMMYYYYValidator DateMMDDYYYYValidator DateYYYYMMDDValidator
BlockBase.AttributeString calls BlockBase.GetAttributes()
If you want to add new attribute to the output of BlockBase.AttributeString, please modify the GetAttributes()
TextBoxBlock is just a built-in element. If you want to change default behaviour of (built-in) TextBox, I think you should override its template and business to your own need, to create your customizedTextBoxBlock element.
i see email validation on text field doesnt work and we still get spam (in email field as non emails) . How can we enable server side validation for text field ?
Hi, the EmailValidator will validate on both client side and server side as default. You can disable javascript on browser to see if it validate.
I want to add maxlength to my input textbox (I use epiServer Forms 4.2.1), but I can't do this in epiServer CMS.
There is an option to make this work? There is a clue in the code that it is supported: