leading zeros missing within number input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 09:36 PM
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>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 10:00 PM
Hey Saranya,
<input type="text" 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" " />
You can type as text to store numbers so that will not remove the leading zeros.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 10:03 PM
Hello Nayn,
Here It allowing me to enter alphabet which I don't need

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 10:35 PM
Use this-
<input type="text" name="number" pattern="^[0-9]{6,10}$" title="digit min 6 and max 10 digits">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 10:48 PM