[whatwg] Wish for HTMLFormElement.checkValidity(boolean)

So I had to go back into the list archives in 2011/2012 to see the reasons
for current behavior. Scripting has no way of trigger full UI validation.
Calling form.submit() submits without validation; calling
form.checkValidity() will highlight an error but not do any messages. The
reason stated was [1]:

"The theory is that if you are not letting the user agent submit the form,
you probably also want to display the validation UI manually. You can
easily do that by using the "validationMessage" attribute on all the
elements in the form.elements list."

I don't think that theory is correct. When I looked around, there are too
many internet questions asking how to trigger full UI validation with
scripting. People are looking for this solution (including myself). Today,
the only "full" solution is to completely take over validation and display
messages manually to mimic the browser's default behavior. That's not
really appealing. I am disappointed that I have to "reinvent the wheel" (UI
wise) simply because I want to customize form submission behavior.

One possible solution was to introduce a boolean flag to control when
messages show up [2]. That sounds like a much needed solution. What are
your thoughts on introducing this method?

[1]
http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Jan/0255.html
[2]
http://lists.w3.org/Archives/Public/public-whatwg-archive/2011Sep/0301.html

Cheers,
Paul

Received on Friday, 7 November 2014 15:37:46 UTC