From bddd8554a2fde7503ae5897cd5a7ba6c2be0dbf2 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 25 Aug 2023 01:12:26 -0400 Subject: [PATCH] rely less on id for form updates --- views/honkpage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/views/honkpage.js b/views/honkpage.js index ec9d8db..3e22cd2 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -384,13 +384,13 @@ function hideelement(el) { if (!el) return el.style.display = "none" } -function updatedonker() { - var el = document.getElementById("donker") +function updatedonker(ev) { + var el = ev.target.parentElement el.children[1].textContent = el.children[0].value.slice(-20) - el = document.getElementById("donkdescriptor") - el.style.display = "" - el = document.getElementById("saveddonkxid") + el = el.nextSibling el.value = "" + el = el.parentElement.nextSibling + el.style.display = "" } var checkinprec = 100.0 var gpsoptions = {