leading zeros missing within number input

salu
Mega Guru

Hello

Can some one help in my issue.

When using the element as a numberfield, leading zeros (e.g. 011) are removed even if the number entered does not break the validation rules (e.g. min, max). Is there an attribute to force the zero to remain in the field after it loses focus?

eg.,

<span ng-switch-when="number">

                                  <div ng-form="form1" ng-class="{'has-error': form1.name.$error.maxlength}">

                                  <input type="number" name="name" ng-class="{'form-control-success':columnObj.value > 0 }" ng-maxlength="10" ng-minlength="6" pattern="[0-9]*" class="form-control" ng-model="columnObj.value" " />

                                   

                                  </div>

                                  <div   style = "color: red;" ng-show='!form1.name.$valid' > Please select a 6-10 digit number.</div>

                              </span>

find_real_file.png

find_real_file.png

6 REPLIES 6

try this,


<input type="text" name="number" pattern="/[0-9]*.{6,10}"


  maxlength="10" title="digit   min 6 and max 10 digits">


Not working nayan,



thanks


Saranya