neha verma

neha verma

  • 0
  • 6
  • 114

multiple selection in dropdown

Nov 4 2019 5:36 AM
Hello guys, I want to select multiple values from dropdown list using comma seperated.i m attaching code .plz help me with this.
I am getting output as
,java
,net
 
That' my function
  1. $scope.getKeySkills = function(value) {  
  2. if(value==null){  
  3. console.log(value);  
  4. $scope.form.data.keySkills = value;  
  5. }  
  6. else{  
  7. $scope.form.data.keySkills = ","+value;  
  8. }}  
  9. <div class="col-xl-4 col-lg-6 col-md-12 col-sm-12 col-12 mb-2">  
  10. <label for="validationCustom02">Key skills</label> <font  
  11. color="red">*</font> <select class="form-control inline"  
  12. ng-model="form.keySkill"  
  13. ng-change="getKeySkills(form.keySkill)"  
  14. ng-options="s.name as s.name for s in form.preload.keySkillsList"  
  15. required style="cursor: pointer" id="basic">  
  16. <option value="">--Key skills--</option>  
  17. </select>  
  18. <div class="valid-feedback">Looks good!</div>  
  19. </div>  
  20. <input type="hidden" ng-model="form.id" value="form.data.id">  
  21. <div class="col-xl-4 col-lg-6 col-md-12 col-sm-12 col-12 mb-2">  
  22. <label for="validationCustom01">key skills value</label><font  
  23. color="red">*</font> <input type="text" class="form-control"  
  24. id="validationCustom01" placeholder="values" value=""  
  25. ng-change="getKeySkills(form.keySkill)" ng-model="form.keySkill">  
  26. <div class="valid-feedback">Looks good!</div>  
  27. </div>  

Answers (4)