I have 1 row and 3 column. Each column have 3 buttons with different id
s.
example id:
--column 1-- --column 2-- --column 3--
id="1morning" id="2morning" id="3morning"
id="1evening" id="2evening" id="3evening"
id="1afternoon" id="2afternoon" id="3afternoon"
*I want to disable button in column 2 with id="2evening"
I know how to disable button using javascript but I do not know how to manipulate the javascript so that I can disable the button that I want.
HTML code:
<br>
<div class="col-md-9">
<div class="well.hilang">
<table>
<tr>
<?php
for ($i=1; $i <=3 ; $i++) {
?>
<td>
<?php echo $i;?>
<div class="form-group">
<input class="btn btn-l" type="submit" name="submit" id="<?php echo $i;?>morning" ><br>
<input class="btn btn-l" type="submit" name="submit" id="<?php echo $i;?>evening" ><br>
<input class="btn btn-l" type="submit" name="submit" id="<?php echo $i;?>afternoon" >
</div>
</td>
<?php }
?>
</tr>
</table>
</div>
</div>
JS code:
<?php for ($i=1; $i <=3 ; $i++) { ?>
<script>
document.getElementById("<?php echo $i;?>evening").disabled = true;
</script>
<?php } ?>
The problem is the Javascript disabled button in all column that have id="1evening"
, id="2evening"
and id="3evening"
. What I want is to disable button with id="2evening"
only.
Thanks, faizal