Index: trunk/extensions/Wikidata/OmegaWiki/forms.php |
— | — | @@ -30,7 +30,11 @@ |
31 | 31 | // a disabled checkbox returns no value, as if unchecked |
32 | 32 | // therefore the value of a disabled, but checked, checkbox must be sent with a hidden input |
33 | 33 | if ( $disabled ) { |
34 | | - return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/><input type="hidden" name="' . $name . '" value="' . $isChecked . '"/>'; |
| 34 | + if ( $isChecked ) { |
| 35 | + return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/><input type="hidden" name="' . $name . '" value="1"/>'; |
| 36 | + } else { |
| 37 | + return '<input disabled="disabled" type="checkbox" name="' . $name . checkBoxCheckAttribute( $isChecked ) . '/>'; |
| 38 | + } |
35 | 39 | } else { |
36 | 40 | return '<input type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '/>'; |
37 | 41 | } |
— | — | @@ -38,7 +42,11 @@ |
39 | 43 | |
40 | 44 | function getCheckBoxWithOnClick( $name, $isChecked, $onClick, $disabled = false ) { |
41 | 45 | if ( $disabled ) { |
42 | | - return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/><input type="hidden" name="' . $name . '" value="' . $isChecked . '"/>'; |
| 46 | + if ( $isChecked ) { |
| 47 | + return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/><input type="hidden" name="' . $name . '" value="1"/>'; |
| 48 | + } else { |
| 49 | + return '<input disabled="disabled" type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . '"/>'; |
| 50 | + } |
43 | 51 | } else { |
44 | 52 | return '<input type="checkbox" name="' . $name . '"' . checkBoxCheckAttribute( $isChecked ) . ' onclick="' . $onClick . '"/>'; |
45 | 53 | } |