Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#8638 closed defect (invalid)

Programatically submitting dijit.form.Form not return falseable, stoppable.

Reported by: Pete Smith Owned by:
Priority: high Milestone: tbd
Component: Dijit - Form Version: 1.2.3
Keywords: dijit.form.Form Cc:
Blocked By: Blocking:


I had to submit a form from an outside button click, and do my own submit action- and physically could not get the form to stop submitting natively. I supplied an onSubmit method to the form, args="evt", (dojo.method) and did dojo.stopEvent(evt) as I always have. Strangely, this works in IE!? But ff says that evt is undefined, which it is. I tried doing onsubmit=return false and even doing an _onSubmit dojo/method to try and stop the event, but it won't stop it since it isn't there.

Only workaround is to hide a native submit button and click that one from outside button.

Change History (7)

comment:1 Changed 13 years ago by Pete Smith

<form dojoType="dijit.form.Form" onsubmit="return false;// doesnt matter">
<script type="dojo/method" event="onSubmit" args="evt">
I dont get an evt here !
<div djtype="dijit.form.Button" onClick="dijit.byId('myform').onSubmit()"></div>
//Also tried .submit() same deal!

comment:2 Changed 13 years ago by Douglas Hays

Having both onsubmit= and dojo/method for onSubmit are redundant. Also, the button should call submit() and not onSubmit(). Adding

<button dojoType="dijit.form.Button" type="button"
onclick="dijit.byId('myForm').submit()">Submit programmatically</button>

after the end form tag in dijit/tests/form/Form.html was shown to work correctly (form could be submitted and was also cancellable).

comment:3 Changed 13 years ago by Pete Smith

I am closing since this seems to be a by product of me overriding dijit.form.Form with my own form. If that does break this it seems odd, but I would imagine it isn't a dijit problem.

comment:4 Changed 13 years ago by Eugene Lazutkin

Resolution: invalid
Status: newclosed

Closing per reporter's request.

comment:5 Changed 13 years ago by bill

(In [16708]) Metadata for Menu widgets. Refs #8638 !strict

comment:6 Changed 13 years ago by bill

Oops, above comment is for #8636.

comment:7 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.