I'd like to transform my form to a custom Joomla component and everything works fine, except for the checkboxes.
The problem: If the checkbox is checked in the add-function and I go to the edit-function, uncheck the checkbox. I stays checked. Below is my code. I can understand the it stays checked with my code, but can't think of a solution, without using javascript(don't have any javascript knowledge).
Hopefully someone can help.
<tr>
<td><label for="label">label</label></td>
<td><input id="label" name="energielabel" type="checkbox" value="1"<?php if($task = 'edit' and $row->label == '1'){echo 'checked';}?> ></td>
</tr>