#4034 closed defect (fixed)
blank NumericTextBox support
Reported by: | bill | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Dijit - Form | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
As explained in http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-development-discussion/validation-textbox-design-request
<input dojotype=NumericTextBox>
and
<input dojotype=NumericTextBox value="">
should show a blank textbox rather than 0, to allow optional number fields in a form, and also because that's how normal HTML works.
Due to the constraints of the parser, "value" in the prototype needs to be a number, not null. So, numeric widgets should define value as NaN and display/transmit an NaN value as the empty string. IE, if value==NaN getValue() and getDisplayedValue()? should return null. Same way as DateTextBox? is working.
The parser (str2obj) should be changed to return NaN rather that 0 for a blank value.
See also #4033.
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [10020]) Fixes #4034. Default NumberTextBox? to NaN instead of 0.
comment:3 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
(In [10019]) References #4034. Change the str2obj to return NaN for value="" wrt number attributes.