[Dojo-checkins] [dojo] #4982: dijit.form.Button ignores form onsubmit
dojo
trac at dojotoolkit.org
Thu Nov 1 15:02:16 UTC 2007
#4982: dijit.form.Button ignores form onsubmit
---------------------+------------------------------------------------------
Reporter: guest | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: General | Version: 0.9
Severity: normal | Keywords:
---------------------+------------------------------------------------------
I've noticed a change in behaviour when clicking a button with
type="submit" between 0.9 beta and later versions. Say you have the
following form:
<form action="foo.php" method="POST" onsubmit="return confirm('Are you
sure?')">
<button dojoType='dijit.form.Button' type="submit">Save</button>
</form>
In the beta version of 0.9 the onsubmit event fired when the button was
clicked. In later versions it does not.
Looking at the code, I found the culprit in the onClick method (refactored
to _onButtonClick since r11107), below a comment saying that "for some
reason type=submit buttons don't automatically submit the form; do it
manually".
I'm not sure this is true: the buttons did submit the form correctly in
Firefox and IE previously - I suspect that it is caused by the
dojo.stopEvent(e) just above. Is this needed?
Either way, I do not think the button should bypass the form's onsubmit.
--
Ticket URL: <http://trac.dojotoolkit.org/ticket/4982>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit
More information about the Dojo-checkins
mailing list