[Bug 16051] New: Triggering contextual error message for inputs

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16051

           Summary: Triggering contextual error message for inputs
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: xaviermd@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Hi everyone

I'm actually dev'ing on a intranet application in HTML5 with XHR (so
sorry, but i can't give access to any example). You can see a test there :
http://jsfiddle.net/bz88V/

For a <form> I wish on make an XHR, I test the validity of the form,
like this :

if (form.checkValidity())
{
  $.post([...]);
} else {

   errormessages();

}

on the same way, into the return of the post (the [...] part), i can
have error validating messages from the server. So I attach them to
the inpts like this :
input.setCustomValidity(le_error_message);
le_error_message is really attached as I can see into
input.validationMessage
the :invalid css selector is set to the input but...

How can I trigger the browser (firefox, chrome, etc...) to display
their standard contextual error-message ?

I tried form.submit(), but it will really submit the form, even
skipping what I wish the browser should do.
I can't see any reference to that, nor into inspecting <input>
and <form> elements.


French speaking paper
http://dascritch.net/post/2012/02/21/Validations-complexes-de-HTML5-farcies-au-Javascript

Sorry my french.
Xavier Mouton-Dubosc
  http://Dascritch.com
  @dascritch

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Tuesday, 21 February 2012 08:31:36 UTC