From a30f697ccb46c071e9d0c55cb658d9bec1f59ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Gr=C3=B6nlund?= Date: Thu, 26 Sep 2024 15:53:24 +0200 Subject: [PATCH] fix: add listener for meter start on dom load --- src/bocken/templates/journalentry_create.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bocken/templates/journalentry_create.html b/src/bocken/templates/journalentry_create.html index 3bb909f..c874880 100644 --- a/src/bocken/templates/journalentry_create.html +++ b/src/bocken/templates/journalentry_create.html @@ -112,6 +112,7 @@

{% translate 'Previous entries' %}

document.querySelector("#nr-kilometers").innerHTML = value; } document.getElementById("id_vehicle").addEventListener("change", getSpecificVehicleValue); + document.addEventListener("DOMContentLoaded", getSpecificVehicleValue); function getSpecificVehicleValue(){ // fetch primary key based on selection in option-element const v_id = document.getElementById("id_vehicle").value;