Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#4571 closed defect (fixed)

onChange not being fired with a 0 entered in ValidationTextBox

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.0
Component: Dijit - Form Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


In _FormWidget.js, there is the following code:

priorityChange) && newValue != this._lastValueReported){

this._lastValueReported = newValue; this.onChange(newValue);


The problem is in the newValue != this._lastValueReported. When the value is empty, then _lastValueReported is "". In javascript "" == 0, so when the user enters a 0, the this.onChange is never called. This causes a problem for those wanting to catch a 0 being entered. I have not found a workaround, as setting the value to null automatically sets the value to "". The fix is to make the test be newValue !== this._lastValueReported so that no type conversion takes place.

Change History (3)

comment:1 Changed 15 years ago by bill

Milestone: 1.0
Owner: set to Douglas Hays

comment:2 Changed 15 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [10643]) Fixes #4571. Compare values with !== instead of !=

comment:3 Changed 11 years ago by bill

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