Checkbox issues - validation?
Hello,
Me again, I read through the topics on here and found mention of people having checkbox issues here and there, but I don't think there has been any concensus on a solution yet, so I thought I should bring it up again.
I have a checkbox being created by the DA wizzard and it always comes up as selected by default on an insert form.
The generated code for the checkbox is here and there seem to be some obvious issues in the code that is generated. Is a solution planned for the near future?
<li class="formItem">
<div class="formGroup">
<div class="lineGroup">
<div class="fullColumnGroup"><label for="page_locked" class="sublabel" >Page is locked from editing?:</label>
<div class="errorGroup">
<div class="fieldPair">
<div class="fieldGroup">
<span>
<label class="checklabel" for="page_locked"><input type="checkbox" name="page_locked" id="page_locked" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("sitepagesinsert","page_locked"):""),""))) {echo "checked=\"checked\"";} ?> tabindex="30"></label>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
The important part:
<input type="checkbox" name="page_locked" id="page_locked" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("sitepagesinsert","page_locked"):""),""))) {echo "checked=\"checked\"";} ?> tabindex="30">
What works:
<input type="checkbox" name="page_locked" id="page_locked" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((ValidatedField("sitepagesinsert","page_locked")),1))) {echo "checked=\"checked\"";} ?> tabindex="30">