PDA

View Full Version : [CLOSED] NumberField - Validation



sisa
Oct 31, 2014, 8:57 AM
Good Morning all

I need to Validate the Input of a NumberField.

Required: Decimal 12,3

Id did this :

NumberField
MaxLength="12"
DecimalPrecision="3"


The Validation seems to work only for the 'MaxLenght'.

I tried 'MaxLenght=16' to include the Decimal Separator and take the whole Number - doesn't work.
I also tried to define the Decimal Separator with it's Attribute (set to '.') doesn't work either...

Could some one give me an Example how to Validate an Decimal 12.3 input ? We need to deliver a solution ASAP...

Kind Regards

Peter

Daniil
Oct 31, 2014, 11:28 AM
Hi Peter,

There is no such the functionality to set individual MaxLenght for integer and decimal parts.

Maybe, a TextField with an InputMask?
http://examples2.ext.net/#/Form/TextField/InputMask/

sisa
Nov 03, 2014, 7:16 AM
Daniil

Does the 'DecimalPrecision' property work on NumericFields ?


<ext:NumberField runat="server" ID="txtNetMass" FieldLabel=" NetMass" FieldStyle="text-align:right;" Width="300" DecimalSeparator="." DecimalPrecision="3" HideTrigger="True">


I got this code above and see no validation Error while entering some thing like '1.1234' ?

Peter

Daniil
Nov 03, 2014, 7:27 AM
Yes, it looks .DecimalSeparator is not taken into account on validation. Though, it works in a different way. If a NumberField blurs, then its decimal part is truncated according to the DecimalSeparator setting.

You can try to implement your own validation using a NumberField's Vtype or Validator.