simplify cookie
This commit is contained in:
parent
a68b92005a
commit
41fdaee2d3
1 changed files with 4 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ getCookie = () => {
|
||||||
c = c.substring(1);
|
c = c.substring(1);
|
||||||
}
|
}
|
||||||
if (c.indexOf(name) === 0) {
|
if (c.indexOf(name) === 0) {
|
||||||
return c.substring(name.length, c.length);
|
return JSON.parse(c.substring(name.length, c.length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -201,9 +201,9 @@ ${document.querySelector("#purpose input").value}
|
||||||
// Fill in form from cookie
|
// Fill in form from cookie
|
||||||
const cookie = getCookie();
|
const cookie = getCookie();
|
||||||
if (cookie !== "") {
|
if (cookie !== "") {
|
||||||
document.querySelector("#name input").value = JSON.parse(cookie).name;
|
document.querySelector("#name input").value = cookie.name;
|
||||||
document.querySelector("#iban input").value = JSON.parse(cookie).iban;
|
document.querySelector("#iban input").value = cookie.iban;
|
||||||
document.querySelector("#bic input").value = JSON.parse(cookie).bic;
|
document.querySelector("#bic input").value = cookie.bic;
|
||||||
}
|
}
|
||||||
|
|
||||||
validateName(document.querySelector("#name input"));
|
validateName(document.querySelector("#name input"));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue