Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set NumberTextBox accepts only digits in dojo?

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"
like image 497
Vijin Paulraj Avatar asked Apr 06 '12 07:04

Vijin Paulraj


1 Answers

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.

like image 139
0xc0de Avatar answered Oct 27 '22 17:10

0xc0de