Opened 16 years ago

Closed 15 years ago

#800 closed defect (fixed)

Button widget cannot submit forms

Reported by: bill Owned by: bill
Priority: high Milestone: 0.9
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


It's not possible to use the dojo::Button as the triggering mechanism to submit a form. For example, changing line 84 of the example (

<input type="submit" name="save" value="Save" />

into something like:

<button dojoType="Button" onclick="document.myformname.submit(); return false;" id="buttonId" >save</button>

When I try to apply this change it does not pass through the FormBind? handlers (nor load, nor onsubmit).

Presumably there needs to be a hidden <button> object that gets pressed when the button is clicked.

Change History (5)

comment:1 Changed 15 years ago by dylan

Milestone: 0.40.5

event handlers do not get transferred to the dom node here... should they be copied in?

comment:2 Changed 15 years ago by dylan

Owner: changed from anonymous to dylan
Status: newassigned

Actually, event handlers are used here... the main issue I see with firefox at least is that your form still has to have a submit button, even if it is hidden, for it to be possible to submit a form. I'll add this to and close.

comment:3 Changed 15 years ago by dylan

Component: WidgetsDocumentation
Milestone: 0.50.4

comment:4 Changed 15 years ago by bill

Component: DocumentationWidgets
Milestone: 0.40.5
Owner: changed from dylan to bill
Status: assignednew

Actually, the reason I wrote this bug is because I don't want users to have to have a hidden submit button. If you think about degradability (if javascript is disabled), and also ease of use, then it's clear that

<button dojoType="Button" type="submit">

needs to work the same as

<button type="submit">

I tried to write the contract here:

Anyway, I can deal with this bug for 0.5.

comment:5 Changed 15 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

This should be fixed with the new Button widget

Note: See TracTickets for help on using tickets.