Fix: old values are retrieved even when not present at page load
This commit is contained in:
parent
601179eba5
commit
111987bdab
1 changed files with 8 additions and 0 deletions
|
@ -11,6 +11,14 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
||||||
};
|
};
|
||||||
_selector.addEventListener('change', function (event) {
|
_selector.addEventListener('change', function (event) {
|
||||||
if (_selector.checked) {
|
if (_selector.checked) {
|
||||||
|
data = {
|
||||||
|
title: document.querySelector('#id_title').value,
|
||||||
|
authors: document.querySelector('#id_authors').value,
|
||||||
|
publicationYear: document.querySelector('#id_publication_year').value,
|
||||||
|
isbn: document.querySelector('#id_isbn').value,
|
||||||
|
price: document.querySelector('#id_price').value,
|
||||||
|
editor: document.querySelector('#id_editor').value,
|
||||||
|
};
|
||||||
document.querySelector('#id_title').value = "PAS DE LIVRE POUR CETTE CLASSE";
|
document.querySelector('#id_title').value = "PAS DE LIVRE POUR CETTE CLASSE";
|
||||||
document.querySelector('#id_authors').value = "N/A";
|
document.querySelector('#id_authors').value = "N/A";
|
||||||
document.querySelector('#id_publication_year').value = 1900;
|
document.querySelector('#id_publication_year').value = 1900;
|
||||||
|
|
Loading…
Reference in a new issue