Skip to content

Commit

Permalink
Fixed checkboxes to not revert back to checked if set as default value
Browse files Browse the repository at this point in the history
and submitted as not checked.
  • Loading branch information
pijulius committed Aug 15, 2012
1 parent ccf7d0d commit fec5bae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sources/form.class.php
Expand Up @@ -565,7 +565,9 @@ function get($elementname) {
$value && isset($this->elements[$elementid]['Values'][(int)($value-1)]))
$value = $this->elements[$elementid]['Values'][(int)($value-1)]['Value'];

if (!isset($value) && !empty($this->elements[$elementid]['OriginalValue']))
if ($this->elements[$elementid]['Type'] != FORM_INPUT_TYPE_CHECKBOX &&
$this->elements[$elementid]['Type'] != FORM_INPUT_TYPE_RADIO &&
!isset($value) && !empty($this->elements[$elementid]['OriginalValue']))
$value = $this->elements[$elementid]['OriginalValue'];

if (!isset($value))
Expand Down

0 comments on commit fec5bae

Please sign in to comment.