I have two forms (consisting of checkboxes) on two different PHP pages. I want to use the values submitted from the first form to disable checkboxes in the second form.
page1.php:
<form method="POST" action="page2.php">
<input type="checkbox" id="1">
<input type="checkbox" id="2">
<input type="checkbox" id="3">
<input type="checkbox" id="4">
<input type="checkbox" id="5">
<input type="checkbox" id="6">
<input type="submit">
</form>
page2.php:
<form method="POST" action="action.php">
<input type="checkbox" id="1">
<input type="checkbox" id="2">
<input type="checkbox" id="3">
<input type="checkbox" id="4">
<input type="checkbox" id="5">
<input type="checkbox" id="6">
<input type="submit">
</form>
<script>
if(!isset($_POST['2'])){
document.getElementById("4").disabled = true;
}
</script>
What should I use instead of this?
if(!isset($_POST['2']))
I can't use jQuery due to professor limitations.