Ticket #2666 (closed enhancement: fixed)

Opened 16 months ago

Last modified 5 months ago

Form widgets should reset to initial value

Reported by: peller Owned by: doughays
Priority: high Milestone: 1.1
Component: Dijit Version: 0.4.2
Severity: normal Keywords:
Cc:

Description

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

Changed 14 months ago by bill

  • component changed from Widgets to Dijit
  • milestone set to 1.0

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

Changed 11 months ago by bill

  • milestone changed from 1.0 to 2.0

Changed 7 months 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.

Changed 5 months ago by bill

  • owner changed from bill to doughays

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.

Changed 5 months ago by peller

  • milestone changed from 2.0 to 1.1

Changed 5 months ago by bill

  • priority changed from normal to high

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

Changed 5 months ago by doughays

  • status changed from new to closed
  • resolution set to fixed

(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.