W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2012

[whatwg] Forms dont submit when disabling submit button

From: Kaustubh Atrawalkar <kaustubh@motorola.com>
Date: Thu, 8 Mar 2012 11:50:49 +0530
Message-ID: <CANw-Mg_VEPO=aMEmxcsQjrz4iFswDNwT=pU+91snpEMbjpDSFA@mail.gmail.com>
Thanks Ian for the comment. There is already a bug filed in webkit -
https://bugs.webkit.org/show_bug.cgi?id=14443 which i was working on. I
will attach this thread for clarification there. I will try to fix the
issue asap.

Regards
--
Kaustubh

On Fri, Jan 27, 2012 at 4:23 AM, Ian Hickson <ian at hixie.ch> wrote:

> On Tue, 27 Sep 2011, Kaustubh Atrawalkar wrote:
> >
> > A simple use case -
> >
> > <form action="javascript:alert('SUCCESS')">
> > <input type="submit" onclick="this.disabled=true; return true;">
> > </form>
>
> (Note: This isn't a "use case", it's a sample. A use case is a description
> of the reason why an author or user wants to do something.)
>
>
> > This does not submit the form in IE, Opera or Webkit but in firefox it
> > does show alert. Considering generic behavior of HTML5 forms, until and
> > unless submit button is active submit action should also be followed by
> > onclick event on submit button. Just need to get what can be the exact
> > behavior here?
>
> The "this.disabled=true" bit should have no effect on the submission
> (since the click has already occurred), and the "return true" part of the
> event handler should have no effect at all.
>
> Thus, assuming the user only clicks once, the above should be equivalent
> to:
>
>  <form action="javascript:alert('SUCCESS')">
>  <input type="submit">
>  </form>
>
> Thus, Firefox is correct here, and WebKit and Opera are wrong. (I didn't
> test IE.)
>
> I recommend filing bugs.
>
> HTH,
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
Received on Wednesday, 7 March 2012 22:20:49 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:40 UTC