I'm trying to make checkbox work like radiobutton with on/off value being passed to $info. This code works fine, variable info is sent and read through GET
<?php if (empty($info)) { $info='on'; } ?>
<input type="checkbox" name="info" value="<?php if ($info=='on'){ echo "off"; } else { echo "on"; } ?>" onchange="this.form.submit()" />
adding this :
**<?php if (!empty($info)){ echo 'checked="checked"'; } ?>**
<input type="checkbox" name="info" value="<?php if ($info=='on'){ echo "off"; } else { echo "on"; } ?>" <?php if (!empty($info)){ echo 'checked="checked"'; } ?> onchange="this.form.submit()" />
breaks something - GET variables are not sent or read, value is always OFF. Why ? It makes not sense.Adding checked="checked" to checkbox makes GET variables for this checkbox not being sent.