#6280 closed defect (fixed)
Unable to prevent form submit
Reported by: | guest | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit | Version: | 1.1b1 |
Keywords: | form submit | Cc: | bill |
Blocked By: | Blocking: |
Description
I am unable to prevent the form submit process on IE7 only. It works fine on ie6, firefox. Problem seen with 1.1b3 and 1.1rc1
<form dojoType="dijit.form.Form" id="myForm" onSubmit="return false;"> <input id="idSearch" type="text" dojotype="dijit.form.TextBox" name="line" style="width: 12em" trim="true" /> <button dojoType="dijit.form.Button" type="submit"> No submit </button> </form>
Change History (8)
comment:1 Changed 13 years ago by
Milestone: | → 1.1 |
---|---|
Owner: | set to Douglas Hays |
Version: | → 1.1b1 |
comment:2 Changed 13 years ago by
Cc: | bill added |
---|---|
Owner: | changed from Douglas Hays to alex |
Priority: | normal → high |
Sorry, about the prior post but I was only looking at dijit changes before.
If I take the current trunk and roll back only dojo/_base/html.js to [12893] then it works. Probably the ability of dojo.attr to handle value types of function is broken.
comment:3 Changed 13 years ago by
severity: | major → blocker |
---|
Run dijit/demos/form.html on any browser
Press OK. Press Cancel to not submit the form, but the submit proceeds.
comment:4 Changed 13 years ago by
Keywords: | ie7 removed |
---|---|
Summary: | Unable to prevent form submit ie7 only → Unable to prevent form submit |
dojo.attr was changed in revision [12899] to use connect for function values. But this doesn't work for functions like onsubmit and onreset that have to return a boolean that tell the browser whether to proceed or not. There may be other functions that work the same as well (onclick?).
comment:6 Changed 13 years ago by
doughays: using dojo.connect() for those events allows us to handle cancelation in a uniform way. The preferred syntax for the above is:
<form dojoType="dijit.form.Form" id="myForm" onSubmit="dojo.stopEvent(arguments[0]);">
Which will call dojo.stopEvent() on the passed event object on all browsers which I've tested on. I'll update the docs on dojo.attr()'s behavior and also add a test cage for this use-case, but fundamentally it's not a bug.
Regards
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
regression in [12067]