Opened 9 years ago
Closed 9 years ago
#14409 closed defect (invalid)
FilteringSelect: required=true considers value="" valid
Reported by: | jond | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit - Form | Version: | 1.7.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
This is my first bug report, I apologize if its improper. Im using svn trunk.
So basically, If i use required:true the FilteringSelect? does not consider value="" as an invalid option. Example.
<select id="foo" data-dojo-type="dijit.form.FilteringSelect" data-dojo-props="required:true"> <option value="">-Please Select-</option> <option value="valid">valid option</option> </div>
Examination of the isValid() function reveals.
return this.item || (!this.required && this.get('displayedValue') == ""); // #5974
this.item is an object --> Object { name="-Please Select-", id="", value=""}
Since it is likely that this.item will always be an object of that nature... wouldn't this function always return true?
Is this correct? Or am I suppose to override isValid()?
Change History (4)
comment:1 Changed 9 years ago by
Component: | General → Dijit - Form |
---|---|
Description: | modified (diff) |
Owner: | set to Douglas Hays |
Summary: | Possible bug in FilteringSelect. → FilteringSelect: required=true does not consider value="" valid |
comment:2 Changed 9 years ago by
My title is incorrect. it should be. FilteringSelect?: required=true considers value="" valid.
Thank you for the formatting help.
comment:3 Changed 9 years ago by
Summary: | FilteringSelect: required=true does not consider value="" valid → FilteringSelect: required=true considers value="" valid |
---|
comment:4 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The FilteringSelect? has a valid value="" with displayed value="Please Select". Since it is user selectable, then it's valid. You probably meant:
<select id="bar" data-dojo-type="dijit.form.FilteringSelect" data-dojo-props="required:true" placeHolder="Please Select" value=""> <option value="valid">valid option</option> <option value="valid2">valid option 2</option> </select>
If this isn't what you meant, then you will need a custom isValid method.
Huh, isn't that the whole point of required:true flag?
Notes on bug system:
Thanks.