6

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"
0xc0de
  • 8,028
  • 5
  • 49
  • 75
Vijin Paulraj
  • 4,469
  • 5
  • 39
  • 54

1 Answers1

7

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.

Community
  • 1
  • 1
0xc0de
  • 8,028
  • 5
  • 49
  • 75