Opened 15 years ago

Closed 14 years ago

#2666 closed enhancement (fixed)

Form widgets should reset to initial value

Reported by: Adam Peller Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:


For DDDP, hit a form "reset" button and they all go blank, regardless of their initial value. It's likely that most of our form elements have this problem. I'll call this an enhancement. Perhaps we can consider this for dijit.

Change History (7)

comment:1 Changed 15 years ago by bill

Component: WidgetsDijit
Milestone: 1.0

Let's think about it for 1.0, when we implement a form widget.

comment:2 Changed 15 years ago by bill

Milestone: 1.02.0

comment:3 Changed 15 years ago by bill

As suggested in #5318, if this is too hard to do for the general case (since we can't detect when a reset button has been pressed... there's no associated event, apparently), then require the user to use the Form widget to wrap their form, rather than a vanilla <form> node.

comment:4 Changed 14 years ago by bill

Owner: changed from bill to Douglas Hays

Doug and I talked this over at DDD Feb 2008:

Each widget will save it's original value and have a reset() method. reset() method will revert widget to it's initial value in addition to resetting the state to 'untouched' (so mandatory fields aren't yellow even though they are blank).

dijit.Form catches onreset event, cancels it, and then tells underlying widgets to reset().

I guess there wasn't a conclusion about native form elements; will worry about them later.

comment:5 Changed 14 years ago by Adam Peller

Milestone: 2.01.1

comment:6 Changed 14 years ago by bill

Priority: normalhigh

Marking as a beta requirement since patch will (or may) change API to MultiSelect?.

comment:7 Changed 14 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [12482]) Fixes #2666. Add reset() method to form widgets. Changed MultiSelect? get/setValues to get/setValue. Added field reset call to 1 textbox and 1 checkbox example. Added reset automated test to Form.html.

Note: See TracTickets for help on using tickets.