mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 15:21:22 +02:00
Fix CC2r: uncheck not persisting + want_license hiding cc2r when active
Issue 1 — hidden seeds overriding user input: Removed all hidden seed inputs (cc2r, want_license, license_id, license_custom). The .licence-license-choice div is now rendered directly from $formData on page load instead of via HTMX load trigger. This eliminates stale-seed interference on both HTMX radio changes and full form submits. Issue 2 — Interne want_license uncheck clearing CC2r: When want_license is unchecked, CC2r and licence selections are cleared (section hidden). Added hidden want_license=0 so the fragment handler can distinguish "arriving from another access type" (no want_license in POST → preserve values) from "explicit Interne toggle" (want_license present → clear CC2r if off). CC2r is independently toggleable within the visible section. Licence dropdown placeholder changed to 'Aucune licence' for an explicit no-licence choice.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
<?php
|
||||
$name = 'license_id'; $label = 'Licence :'; $options = $licenseTypes;
|
||||
$selected = $licenseId; $placeholder = '— Sélectionner —'; $required = false;
|
||||
$selected = $licenseId; $placeholder = 'Aucune licence'; $required = false;
|
||||
include APP_ROOT . '/templates/partials/form/select-field.php';
|
||||
?>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
|
||||
<div class="admin-form-group">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="hidden" name="want_license" value="0">
|
||||
<input type="checkbox" name="want_license" value="1"
|
||||
hx-post="<?= $hxPost ?>"
|
||||
hx-target=".licence-license-choice"
|
||||
@@ -77,7 +78,7 @@
|
||||
|
||||
<?php
|
||||
$name = 'license_id'; $label = 'Licence :'; $options = $licenseTypes;
|
||||
$selected = $licenseId; $placeholder = '— Sélectionner —'; $required = false;
|
||||
$selected = $licenseId; $placeholder = 'Aucune licence'; $required = false;
|
||||
include APP_ROOT . '/templates/partials/form/select-field.php';
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user