vendredi 28 août 2015

PHP Disabling checkboxes when selected

I am trying to disable a checkbox when selected.

doc1.php

<tr>
    <td>A1</td>
    <td><input type="checkbox" name="A1" value="on" id="A1chk"></td>
</tr>

doc2.php

if (isset($_POST['A1'])){
    array_push($Unavailablearray, 'A1');
    $Availablearray = array_diff($Availablearray, array('A1'));
    fridaydocument.getElementById($_POST["A1chk"]).disabled = true;
}

The code are on different documents. I am trying to disable the checkbox when the form is submitted but only if the checkbox is selected.

The arrays are used for something else on doc2.php




Aucun commentaire:

Enregistrer un commentaire