angularjs - bootstrap form validation for custom field -


i have custom input field in html

<form role="form" class="container"> <div class="form-group">     <label for="slnotificationtype" class="control-label">notification type</label>     <select id="slnotificationtype" class="form-control" ng-model="inputnotificationdata.notificationtype"     data-error="please select option" required>         <option value="" selected hidden>select notification type</option>         <option>email</option>     </select>     <div class="help-block with-errors"></div> </div> <div class="form-group">     <label for="btncategory">notification category</label>     <div class="form-control" required>         <label>             <input type="button" ng-click="showcategories()" value="select category">                 selected :{{selectedcategory.name==null ? 'none' : selectedcategory.name}}         </label>     </div>     <div class="help-block with-errors"></div> </div> ... ... 

on showcategories() function dispaly pop-up, user select category. popup display list of categories fetched server in tabular format. on selection of category, pop-up closed , selected category assigned variable selectedcategory. part of form validation, want check whether user has selected category or not. on other input fields in form, if put "required" attribute, bootstrap validate , display validation error message. how put required property on input of type button?

basically, trying create custom control behaves <input type ="file">, instead of showing file browser, have own popup select category.


Comments