Opened 12 years ago

Closed 12 years ago

#10720 closed defect (wontfix)

Currency/Number Text boxes does not validate when not all decimal places entered

Reported by: snimavat Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0
Keywords: Cc: Douglas Hays
Blocked By: Blocking:


Since Dojo 1.4 if CurrencyextBox? has places:6 specified and user does not enter all six decimal places, it will show error instead of adding trailing zeros.

        <input type="text" dojoType="dijit.form.CurrencyTextBox"
        required="true" constraints="{fractional:true, places:6}" 

Attachments (1)

currency.html (1.3 KB) - added by snimavat 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by snimavat

Attachment: currency.html added

comment:1 Changed 12 years ago by Adam Peller

Cc: Douglas Hays added
severity: blockermajor

I believe this is how places is supposed to work, where places defines a fixed number of decimal places, no more and no less. I think the behavior you're depending on was not intentional. In Dojo 1.3

>>> dojo.currency.parse("$1.23",{currency:"USD", places:6})

so perhaps something changed in the Dijit logic. Doug, does this sound familiar?

It's not official API, but you might try places:'0,6' I think specifying a range might be the proper way to get this behavior. We should probably look at getting that syntax tested and documented.

comment:2 Changed 12 years ago by Adam Peller

Resolution: wontfix
Status: newclosed

The fix in #10669 will enable you to specify something like places:'0,6' and enter anywhere from zero to six decimal places, but the widget currently will not let you enter anything less than the specified amount of places and expect padding.

Note: See TracTickets for help on using tickets.