Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#3165 closed defect (fixed)

dijit.form.ValidationTextbox clears the illegal value when it loses a focus

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

Description

dijit.form.ValidationTextbox replaces an illegal value with an empty string, if it loses a focus. Please note that the empty string is not always a valid choice for a field. It could be reproduced with the existing test_validate.html page.

The correct behavior is: it should leave it there (and retain the "error" class) giving user a chance to correct it later, because it could be mistyped, and a lot of users do not look at the screen while typing. Instead of removing an extra character or correcting a similar simple typo, user is forced to retype the field completely.

At the very least this behavior should be easily customizable by subclassing a widget.

Change History (2)

comment:1 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [8823]) Fixes #3165. Added optional displayedText parameter to Textbox:setValue so that the true value and dispayed value can be set with 1 call and kept in sync. Also, the displayed value is not changed if format() returns an error. Changed Select to use this new feature since its setValue calls are asynchronous.

comment:2 Changed 8 years ago by bill

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