Guest User

Untitled

a guest
Sep 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // that bring the information in boostrap multiselect
  2. var vetornovo = ValueChecked();
  3.  
  4. // here i try to detect the change to check and unchecked but doesnt works
  5. // all informations is selected: "selected" by default
  6. $("#os-select-list").change(function() {
  7. // i take the checkbox value.
  8. var valueck = parseInt($("#os-select-list option:selected").text());
  9.  
  10. // if the information is in that i array when i click to unchecked then remove.
  11. if (vetornovo.indexOf(valueck) > -1) {
  12. index = $.inArray(valueck, vetornovo);
  13. vetornovo.splice(index, 1);
  14. console.log(vetornovo);
  15. // when i click to selecte the value again i push and insert back to the array.
  16. } else {
  17. vetornovo.push(valueck);
  18. console.log(vetornovo);
  19. }
  20. });
Add Comment
Please, Sign In to add comment