Select to view content in your preferred language

NumberTextBox glitch?

1687
2
Jump to solution
10-15-2015 09:39 AM
LefterisKoumis
Frequent Contributor

I created a coordinate widget that has two text boxes to accept the long and lat from the user.

I used the dijit/form/NumberTextBox.

At first, I didn't use any constraints but it seems it would not display any numbers with more than 3 decimal places!

Then, I introduced the constraints and specify decimal places.

With the constrainsts, the NumberTextBox will display more than 3 decimal places but it prompts that this is not a numeric value!!!

What am I doing wrong?

Thanks.

<input id="longitude" type="text"

    data-dojo-type="dijit/form/NumberTextBox"

    name= "long"

    required="true"

    value=""

    data-dojo-props="constraints:{min:-900000000000,max:900000000000,places:10}, invalidMessage:'Please enter a numeric value.'" />

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

  Here is what I use in my eSearch widget for numeric entry:

<input data-dojo-attach-point="numberTextBox" data-dojo-type="dijit/form/NumberTextBox"
                     data-dojo-props="intermediateChanges:true,constraints: {pattern: '#####0.##########'}"
                     class="dijit-form-NumberTextBox" style="display:none;width:100%;height:30px;" />

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

  Here is what I use in my eSearch widget for numeric entry:

<input data-dojo-attach-point="numberTextBox" data-dojo-type="dijit/form/NumberTextBox"
                     data-dojo-props="intermediateChanges:true,constraints: {pattern: '#####0.##########'}"
                     class="dijit-form-NumberTextBox" style="display:none;width:100%;height:30px;" />
0 Kudos
LefterisKoumis
Frequent Contributor

Thank you. I used the pattern and it works. I will mark this as answered but the dojo documentation should list any limitations with the NumberTextBox.

0 Kudos