Selecting checkbox and saved

-1

If I have a checkbox that marks all the checkboxes by default, however, it does not mark the one of the other windows, that is, the tab 1 are all selected, but the others are not.

At the time of saving, it does not validate the data that was selected. Within the function "action2" is the code that registers in case there are more than two marked checkboxes, however it does not enter that condi tion, you will be added an" ENTRÓ "message to know what you are entering and does not respect it.

However if I do it manually, selecting one by one, if you enter that condition and save it. enter the description of the image here
Greetings!

    
asked by Alejandro Oscar 09.11.2017 в 16:48
source

1 answer

0

If I'm not mistaken, that happens because the data from the other pages is loaded dynamically. To simulate the operation properly you can try to load the new page to check if the checkbox is checked which marks all the checkboxes as selected and mark the ones on that page.

Put an id to the checkbox, something like id="marca_todos"

if (document.getElementById("marcar_todos").checked) {
    // Codigo para obtener todos los checkbox de esta pagina y marcarlos
}

To keep all the results of the search I think it is best to send the search parameters to the server, get all the results again and, if the checkbox is marked "marca_todos", save all those results (or perform the operations you need)

    
answered by 09.11.2017 в 17:07