Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14785 closed defect (invalid)

dijit.form.NumberTextBox pattern

Reported by: vtsuper Owned by: Douglas Hays
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.7.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Below are 2 textbox in same constraints with different dojo type.

<input data-dojo-type="dijit.form.CurrencyTextBox" data-dojo-props="value:0, constraints:{min:-999999999.9, max:999999999.9, pattern:'#.#', places:1}" />

<input data-dojo-type="dijit.form.NumberTextBox" data-dojo-props="value:0, constraints:{min:-999999999.9, max:999999999.9, pattern:'#.#', places:1}" />

when I type a number for example '6', I suppose it will convert to 6.0 automatically since my pattern is '#.#' it works in dijit.form.CurrencyTextBox but not in dijit.form.NumberTextBox.

is it a bug or my patterns problem?

http://dojo-toolkit.33424.n3.nabble.com/file/n3734372/number.gif

Change History (5)

comment:1 Changed 8 years ago by bill

Component: GeneralDijit - Form
Description: modified (diff)
Owner: set to Douglas Hays

comment:2 Changed 8 years ago by Douglas Hays

Resolution: invalid
Status: newclosed

You didn't specify is the fraction was optional or required (default). Add fractional:[true,false] to the constraints. That's already set for CurrencyTextBox?.

comment:3 Changed 8 years ago by vtsuper

after I add fractional it still not work.

would you pls test it by 6 and 6.7, it works in CurrencyTextBox? but not in NumberTextBox?

http://jsfiddle.net/vtsuper/Mgwte/

comment:4 Changed 8 years ago by Douglas Hays

You tried fractional:true, and fractional:false. That's not what I suggested
fractional:[true,false]

comment:5 Changed 8 years ago by vtsuper

it works now....thx!!!!!

Note: See TracTickets for help on using tickets.