|
|
@ -340,7 +340,7 @@ if (!$isConfig and $hasSupplier) { |
|
|
|
</section> |
|
|
|
<section class="container-fluid"> |
|
|
|
<div class="row g-3"> |
|
|
|
<form action="<?php printf('%s?supplier=%s', $requestUrl, $supplier); ?>" method="post"> |
|
|
|
<form class="js-localremember" action="<?php printf('%s?supplier=%s', $requestUrl, $supplier); ?>" method="post"> |
|
|
|
<div class="row mb-3"> |
|
|
|
<label for="title" class="col-sm-2 col-form-label">Nom</label> |
|
|
|
<div class="col-sm-10"> |
|
|
@ -442,5 +442,25 @@ if (!$isConfig and $hasSupplier) { |
|
|
|
}); |
|
|
|
</script> |
|
|
|
<?php endif; ?>
|
|
|
|
<script> |
|
|
|
document.querySelectorAll('.js-localremember').forEach(function (form) { |
|
|
|
const fields = [ 'name', 'choice' ]; |
|
|
|
|
|
|
|
form.addEventListener('submit', function (event) { |
|
|
|
fields.forEach(function (field) { |
|
|
|
window.localStorage.setItem('mon_panier_bio_' + field, form.elements[field].value); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
fields.forEach(function (field) { |
|
|
|
if ( |
|
|
|
(form.elements[field].value === '') |
|
|
|
&& (window.localStorage.getItem('mon_panier_bio_' + field) !== null) |
|
|
|
) { |
|
|
|
form.elements[field].value = window.localStorage.getItem('mon_panier_bio_' + field); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |