I need one help.I have a input field validation and this field only accepts the number including decimal value also using Angular.js pattern.I am explaining my code below.
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">
Unit Sale Price :
</span>
<div ng-class="{ 'myError': billdata.usp.$touched && billdata.usp.$invalid }">
<input type="text" name="usp" id="usp" class="form-control"
placeholder="Add Unit Sale Price"
ng-model="unit_sale_price"
ng-keypress="clearField('usp');"
ng-keyup="setLatestSalePrice();"
ng-pattern="/^(0|[1-9][0-9]*)$/">
<div style="clear:both;"></div>
</div>
</div>
<div class="help-block" ng-messages="billdata.usp.$error"
ng-if="billdata.usp.$touched || billdata.usp.$error.pattern">
<p ng-message="pattern" style="color:#F00;">
This field needs only number(e.g-0,1..9).
</p>
</div>
Here my problem is the decimal like value are also not taken by this field.Here i need only characters are also not allowed.Please help me.