[ 
https://issues.apache.org/jira/browse/WICKET-5331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15294808#comment-15294808
 ] 

Sven Meier commented on WICKET-5331:
------------------------------------

This issue was mainly about the required attribute of TextFields and TextAreas.

You're right, that minLength is an HTML5 attribute too, but StringValidator 
still writes it by default.
It could be argued (preferably on the mailing list) whether we should change 
this, but as a workaround you can override StringValidator#onComponentTag() and 
leave it empty to suppress writing of the attribute - or just roll your own 
subclass of AbstractRangeValidator.



> Make html5 form validation configurable
> ---------------------------------------
>
>                 Key: WICKET-5331
>                 URL: https://issues.apache.org/jira/browse/WICKET-5331
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 6.10.0
>            Reporter: Ulrike M
>            Assignee: Sven Meier
>             Fix For: 6.11.0, 7.0.0-M1
>
>         Attachments: HTML5Forms.java
>
>
> Due to WICKET-5289, Wicket 6.10.0 adds html5 'required' attributes to all 
> TextArea and TextFields.
> This causes html5 compliant browsers (e.g. Firefox) to display a generic 
> error ('Please fill out this field') on such text fields if left empty.
> Compared to the error messages one can display using wicket's validation 
> infrastructure, this is a rather poor user experience. Since browsers don't 
> submit the form if a html5 validation message is displayed, there's no way to 
> provide a more meaningful error message.
> Unfortunately, there is currently no easy way to disable html5 form 
> validation in a wicket web app. It is now necessary to create subclasses of 
> TextField and TextArea that revert the undesired behavior of those 
> components, which is obviously a lot of work. There should be an easy way to 
> disable the generation of html5 form validation attributes. I would like to 
> propose the introduction of a global setting (maybe in IMarkupSettings or 
> some other I*Settings interface?) that controls the automatic generation of 
> all html5 form validation attributes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to