Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // that bring the information in boostrap multiselect
- var vetornovo = ValueChecked();
- // here i try to detect the change to check and unchecked but doesnt works
- // all informations is selected: "selected" by default
- $("#os-select-list").change(function() {
- // i take the checkbox value.
- var valueck = parseInt($("#os-select-list option:selected").text());
- // if the information is in that i array when i click to unchecked then remove.
- if (vetornovo.indexOf(valueck) > -1) {
- index = $.inArray(valueck, vetornovo);
- vetornovo.splice(index, 1);
- console.log(vetornovo);
- // when i click to selecte the value again i push and insert back to the array.
- } else {
- vetornovo.push(valueck);
- console.log(vetornovo);
- }
- });
Add Comment
Please, Sign In to add comment