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);
|
||||
}
|
||||
if (c.indexOf(name) === 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
return JSON.parse(c.substring(name.length, c.length));
|
||||
}
|
||||
}
|
||||
return "";
|
||||
|
|
@ -201,9 +201,9 @@ ${document.querySelector("#purpose input").value}
|
|||
// Fill in form from cookie
|
||||
const cookie = getCookie();
|
||||
if (cookie !== "") {
|
||||
document.querySelector("#name input").value = JSON.parse(cookie).name;
|
||||
document.querySelector("#iban input").value = JSON.parse(cookie).iban;
|
||||
document.querySelector("#bic input").value = JSON.parse(cookie).bic;
|
||||
document.querySelector("#name input").value = cookie.name;
|
||||
document.querySelector("#iban input").value = cookie.iban;
|
||||
document.querySelector("#bic input").value = cookie.bic;
|
||||
}
|
||||
|
||||
validateName(document.querySelector("#name input"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue