mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 05:13:01 +00:00
fix: Add hidden input for enabled checkbox to ensure false is submitted
Add hidden input with value='false' before enabled checkbox in custom feeds table to ensure an explicit false value is sent when checkbox is unchecked. Pattern implemented: - Hidden input: name='enabled', value='false' (always submitted) - Checkbox: name='enabled', value='true' (only submitted when checked) - When unchecked: only hidden input submits (false) - When checked: both submit, checkbox value (true) overwrites hidden Updated in two places: - Template checkbox in plugin_config.html (existing rows) - JavaScript addCustomFeedRow function in base.html (new rows) Backend verification: - Backend (api_v3.py) handles string boolean values and converts properly - JavaScript form processing explicitly checks element.checked, independent of this pattern - Standard form submission uses last value when multiple values share same name
This commit is contained in:
@@ -4869,6 +4869,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 whitespace-nowrap text-center">
|
||||
<input type="hidden" name="${fullKey}.${newIndex}.enabled" value="false">
|
||||
<input type="checkbox"
|
||||
name="${fullKey}.${newIndex}.enabled"
|
||||
checked
|
||||
|
||||
Reference in New Issue
Block a user