Hi,
My first time using dojo and dijit and I am having problems with the behavior of a NumberTextBox widget which I hope someone can help me with. The dijit text box is created entirely with javascript code and what I would like it to do is to allow the user to enter a number between -180 and 180 with, optionally, up to 6 decimal places. Here is what I have :
new dijit.form.NumberTextBox({style:"width: 100px",
promptMessage: "Enter a value between -180 and 180",
rangeMessage: "Longitude out of range",
constraints: {min: -180, max: 180, places: '0,6'}});
My problems seem to come from the places constraint which gives me the following behaviour :
Specified as above ('0,6') gives me the correct behavior when typing into the field but as soon as the field loses focus the value entered is truncated to 0 decimal places.
If I specify places as 6 (or '6') then any value other than to 6 decimal places gives an 'invalid value' message when typing in the field.
If I don't specify a places contraint at all then any value entered with more than 2 decimal places gives an 'invalid value' message.
Any help on this is greatly appreciated.
Thanks
Rob

the places-range feature is quirky
I think there's a long-standing ticket on this I've been neglecting. Instead, try constraints: {format: "#.######"}
format: "#.######" does not work either
I tried it with format: "#.######" in the constraints and that does not seem to work either. I do now seem to be able to get up to 3 decimal places before the "invalid value" message (with or without the format constraint), previously thought I could only get to 2 decimal places but maybe I was mistaken.