Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#8266 closed defect (fixed)

FilteringSelect: validates with empty value

Reported by: coldfire22x Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.2.3
Keywords: FilteringSelect validate Cc:
Blocked By: Blocking:

Description

FilteringSelect? will pass validation if the widget was never interacted with, despite having required set to true and containing an empty display value.

this._isvalid defaults to true and prevents isValid() from detecting this.required==true and this.attr('displayedValue')=="" when the form element is never interacted with. It fails validation if it has been focused and blurred.

Attachments (3)

filteringselect.html (1.9 KB) - added by coldfire22x 11 years ago.
Demonstration
8266.patch (475 bytes) - added by haysmark 10 years ago.
Fixes #8266. _isvalid in FilteringSelect? defaults to false to correctly validate the special case of required=true and a blank/unset initial value. Verified FilteringSelect? robot tests passed in FF3.
8266.2.patch (530 bytes) - added by haysmark 10 years ago.
Fixes #8266. _isvalid in FilteringSelect? more robustly initialized to handle the case of required=true and an unset value attribute.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by coldfire22x

Attachment: filteringselect.html added

Demonstration

comment:1 Changed 11 years ago by bill

Owner: set to Douglas Hays
Summary: FilteringSelect validates with empty valueFilteringSelect: validates with empty value

comment:2 Changed 10 years ago by omega_ula

I have this problem too. When are you planning to start working on it?

Changed 10 years ago by haysmark

Attachment: 8266.patch added

Fixes #8266. _isvalid in FilteringSelect? defaults to false to correctly validate the special case of required=true and a blank/unset initial value. Verified FilteringSelect? robot tests passed in FF3.

comment:3 Changed 10 years ago by haysmark

I appended one possible fix. All of the FilteringSelects? will be invalid when the page first loads, but after the server data arrives, the valid ones are marked as valid, and the invalid ones are marked as invalid with valid styling until the user interacts with them.

Changed 10 years ago by haysmark

Attachment: 8266.2.patch added

Fixes #8266. _isvalid in FilteringSelect? more robustly initialized to handle the case of required=true and an unset value attribute.

comment:4 Changed 10 years ago by Douglas Hays

Milestone: tbd1.3
Status: newassigned

comment:5 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

[16406] Fixes #8266. Initialize _isvalid using required.

comment:6 Changed 8 years ago by bill

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