I am building up a table in php built from an array in a database. I can assign each row its own id's etc. But I need to enable or disable checkbox buttons and a text area depending on the checkbox for that row being checked or not.
hotellist.php
-
<div align="center"><input type="checkbox" name="en1" id="en1" onclick="enable1(this.checked)">
-
<input type="hidden" name="editid" id="editid" value="<?php echo $id ?>" /></div>
-
hotel.php
-
<script language="javascript" type="text/javascript">
-
function enable(obj)
-
{
-
var en1=document.getElementById("en1").value;
-
for(i=0;i<en1.length;i++)
-
{
-
if(en1[i].checked==true)
-
{
-
document.getElementById("en1").enabled=true;
-
}
-
}
-
}
-
-
</script>
-
-
-