angularjs-validation

AngularJS Dropdown required validation

二次信任 提交于 2019-11-26 19:22:18
问题 Following is my code snippet. I want to validate my dropdown using angular. <td align="left" width="52%"> <span class="requiredSmall">*</span> <select class="Sitedropdown" style="width: 220px;" ng-model="selectedSpecimen().serviceID" ng-options="service.ServiceID as service.ServiceName for service in services"> <option value="" ng-selected="selected">Select Service</option> </select> </td> Valid means: Valid values can be anything but "Select Service", it is my default value. Like other ASP

Validate phone number using angular js

倾然丶 夕夏残阳落幕 提交于 2019-11-26 16:04:55
问题 Want to set phone-number to 10 digits, How can I do this using Angular js. This is what I have tried: <form class="form-horizontal" role="form" method="post" name="registration" novalidate> <div class="form-group" ng-class="{'has-error': registration.phone.$error.number}"> <label for="inputPhone" class="col-sm-3 control-label">Phone :</label> <div class="col-sm-9"> <input type="number" class="form-control" ng-minlength="10" ng-maxlength="10" id="inputPhone" name="phone" placeholder="Phone" ng