Hello.
Please tell me which side to approach this problem:
There is a construction in HTML:
<input type="checkbox" name="1"> <input type="checkbox" name="2"> <input type="checkbox" name="3"> <input type="checkbox" name="4"> There are arrays in PHP (of course you can rename them):
<? $id_1 = array(1,2,3); $id_2 = array(5,6,7); $id_3 = array(8,9,10); $id_4 = array(11,12,13); ?> using the following JS code, when you turn on any two checkboxes, a specific action is started:
$("input[type='checkbox']").change(function(){ var checked = $("input[type='checkbox']:checked").length; if (checked == 2) { ---действие---; } }); How to make the action to run a separate PHP code that would use arrays corresponding to the checkbox names?
Ps Let me explain why everything is done. There is a table with a list of banks and their lending terms. In addition, arrays were created in which overpayments were recorded by months for each bank (i.e. [0] - overpayment on the loan in the first month for this bank, [1] - in the second and so on. I want to make it so that two banks through a checkbox, a window appeared in which a chart with overpayments of both banks was built through a google chart. Something like this ...