How to set NumberTextBox accepts only digits in dojo?

dojo, validation

Solution

You can have following for example:

constraints: { min:0, places:0}

see also: http://www.unicode.org/reports/tr35/#Number_Format_Patterns

Using the dojo NumberTextBox you are still allowed to enter characters: a, b, c. It only gives you invalid message. If you want to only allow digit input, you can use the javascript here.

Problem

I have the following `NumberTextBox` and i wanted to allow only the digits,but i don't know what is the `constraints` properties used to make it possible. ``` <input type="text" data-dojo-type="dijit.form.NumberTextBox" invalidMessage="Please enter only numbers" constraints="{}" required="true" ```

Original source

Related problems