Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function additem(chk, id, val)
- {
- $("input[name='categoria[]']").each(function (index, element) { element.remove(); });
- $('input[type="checkbox"]:checked').each(function(index, element) {
- var id = element.id;
- var value = element.id.split('_')[1];
- var newinput = '<input type="hidden" name="categoria[]" id="' + id + '" value="' + value + '">';
- console.log(newinput);
- $("#form_categorias").append(newinput);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement