Morning guys,
I've almost finished a new site i'm doing for a client but there's a few points that are causing me a headache and they're all related to the same thing.
I've searched everywhere on the web for an answer and I'm beginning to think that there isn't one that I can implement using my current version of Dreamweaver CS4.
I have a repeating region that is populated from a database table, just some simple 4 column dynamic table but the last column has a checkbox in it. This is being read from the dynamic data as a simple '1' or '0' which I will be using to inform the user whether the task has previously been completed or not. The database is updated on the press of the submit button.
The problem I have is that the first row of data comes back and sets the checkbox to 'checked' but because this a repeating region all the checkboxes display the same result! I can't find any way the next checkbox being 'unchecked' even though the next row in the database is set as '0'.
I've pasted the code below for the section I'm stuck with and I would be amazed if anyone can find a simple solution to this. Maybe Adobe could then implement it into the repeating region panel!! Maybe not....
Any help would be very much appreciated and I would be willing to make a paypal donation if the answer works!
Here's the code:
<?php do { ?>
<tr>
<td height="20"><?php echo ucwords($row_exerciselevelRS['ex_title']); ?></td>
<td><?php echo $row_exerciselevelRS['ex_detail']; ?></td>
<td>
<a href="#" onclick="MM_openBrWindow('qt/<?php echo $row_exerciselevelRS['ex_video_url']; ?>/<?php echo $row_exerciselevelRS['ex_video_url']; ?>.mov','','width=787,height=486')" >
Watch the video</a>
</td>
<td><form id="form1" method="post" action="">
<p>
<input <?php if (!(strcmp($row_completedRS['ex_1'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="complete" id="complete" />
</p>
</form></td>
</tr>
<?php } while ($row_exerciselevelRS = mysql_fetch_assoc($exerciselevelRS)); ?>
I also really need the repeating region to cycle through all the data and display each value on the next line of the table so that the line:
<input <?php if (!(strcmp($row_completedRS['ex_1'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="complete" id="complete" />
also loops through the values of the table such as: ex_1, ex_2, ex_3...etc but I have no idea how to do this!
Cheers for any responses....