Dear all,
I must call a PHP page with a Javascript command.
I developed a function that does almost exactly what I needed:
View code: Example 1
But in the last part where it makes me “view” (document.getElementById(‘showResult’)) only the result, I need to do it in a way that instead calls me another PHP page, where it will execute the instructions passed in this page.
//Example 1
“`
function getCheckedValues()
{
return Array.from(document.querySelectorAll(‘input[type=”checkbox”]’))
.filter((checkbox) => checkbox.checked)
.map((checkbox) => checkbox.value);
}
const resultEl = document.getElementById(‘result’);
document.getElementById(‘showResult’).addEventListener(‘click’, () =>{
resultEl.innerHTML = getCheckedValues();
});
//Link that should I call through the function:
<p>