home · contact · privacy
Make actual input values appear by properly using .setAttribute("value") rather than...
authorChristian Heller <c.heller@plomlompom.de>
Sun, 25 Jan 2026 07:18:37 +0000 (08:18 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 25 Jan 2026 07:18:37 +0000 (08:18 +0100)
src/templates/edit_structured.js
src/tests/full.edit_structured.1
src/tests/full.edit_structured.4
src/tests/full.edit_structured.5

index 0aa6805c497cf6a76d788b9fcbce051d479363fd..e83816adf39a768c2db6852c39ad20821fe36b95 100644 (file)
@@ -175,8 +175,8 @@ const updateForm = () => {
             const input = document.createElement("input");
             td.appendChild(input);
             input.name = `line_${idx}_${name}`;
-            input.value = value.trim();
             input.size = size;
+            input.setAttribute("value", value.trim());
             input.oninput = taint;
             return input;
         };
index 9faa0c63ee3d9dc643080ffd3841d76c774f1dae..f091ec9e0d694330c2aef1424221bf21e25eb3ce 100644 (file)
@@ -108,11 +108,11 @@ to
 <td colspan="1">
 </td>
 <td colspan="3">
-<input name="line_0_date" size="10" id="date_input">
-<input name="line_0_target" size="37">
+<input name="line_0_date" size="10" value="2001-01-01" id="date_input">
+<input name="line_0_target" size="37" value="test">
 </td>
 <td colspan="1">
-<input name="line_0_comment" size="40">
+<input name="line_0_comment" size="40" value="foo">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -124,16 +124,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_1_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_1_account" size="30" value="foo" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_1_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_1_amount" size="12" value="10" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_1_currency" size="3" placeholder="€">
+<input name="line_1_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_1_comment" size="40">
+<input name="line_1_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -146,16 +146,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_2_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_2_account" size="30" value="bar" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_2_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_2_amount" size="12" value="-10" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_2_currency" size="3" placeholder="€">
+<input name="line_2_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_2_comment" size="40">
+<input name="line_2_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
index 46e97f645f681b99bb7d2de6dc4ed122ad565984..7e718189a01357780098a7d4382d46f20ca942aa 100644 (file)
@@ -108,11 +108,11 @@ to
 <td colspan="1">
 </td>
 <td colspan="3">
-<input name="line_0_date" size="10" id="date_input">
-<input name="line_0_target" size="37">
+<input name="line_0_date" size="10" value="2001-01-03" id="date_input">
+<input name="line_0_target" size="37" value="test">
 </td>
 <td colspan="1">
-<input name="line_0_comment" size="40">
+<input name="line_0_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -124,16 +124,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_1_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_1_account" size="30" value="foo:x" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_1_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_1_amount" size="12" value="10" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_1_currency" size="3" placeholder="€">
+<input name="line_1_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_1_comment" size="40">
+<input name="line_1_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -146,16 +146,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_2_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_2_account" size="30" value="foo:x" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_2_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_2_amount" size="12" value="1" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_2_currency" size="3" placeholder="€">
+<input name="line_2_currency" size="3" value="USD" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_2_comment" size="40">
+<input name="line_2_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -168,16 +168,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_3_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_3_account" size="30" value="bar:x:y" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_3_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_3_amount" size="12" value="-10" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_3_currency" size="3" placeholder="€">
+<input name="line_3_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_3_comment" size="40">
+<input name="line_3_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -190,16 +190,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_4_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_4_account" size="30" value="bar:z" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_4_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_4_amount" size="12" value="-1" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_4_currency" size="3" placeholder="€">
+<input name="line_4_currency" size="3" value="USD" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_4_comment" size="40">
+<input name="line_4_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
index 9488d592542f47d125d7149ace49d26151fe7861..1f031eb5ec474392ea75ccf3a8bf40d23ba8323a 100644 (file)
@@ -114,11 +114,11 @@ to
 <td colspan="1">
 </td>
 <td colspan="3">
-<input name="line_0_date" size="10" id="date_input">
-<input name="line_0_target" size="37">
+<input name="line_0_date" size="10" value="2001-01-03" id="date_input">
+<input name="line_0_target" size="37" value="test">
 </td>
 <td colspan="1">
-<input name="line_0_comment" size="40">
+<input name="line_0_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -130,16 +130,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_1_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_1_account" size="30" value="foo:x" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_1_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_1_amount" size="12" value="10" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_1_currency" size="3" placeholder="€">
+<input name="line_1_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_1_comment" size="40">
+<input name="line_1_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -152,16 +152,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_2_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_2_account" size="30" value="foo:x" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_2_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_2_amount" size="12" value="3" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_2_currency" size="3" placeholder="€">
+<input name="line_2_currency" size="3" value="USD" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_2_comment" size="40">
+<input name="line_2_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -174,16 +174,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_3_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_3_account" size="30" value="bar:x:y" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_3_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_3_amount" size="12" value="-9" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_3_currency" size="3" placeholder="€">
+<input name="line_3_currency" size="3" value="€" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_3_comment" size="40">
+<input name="line_3_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>
@@ -196,16 +196,16 @@ to
 <button type="button">v</button>
 </td>
 <td colspan="1">
-<input name="line_4_account" size="30" list="all_accounts" autocomplete="off">
+<input name="line_4_account" size="30" value="bar:z" list="all_accounts" autocomplete="off">
 </td>
 <td colspan="1">
-<input name="line_4_amount" size="12" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
+<input name="line_4_amount" size="12" value="-1" pattern="^-?[0-9]+(.[0-9]+)?$" class="amount">
 </td>
 <td colspan="1">
-<input name="line_4_currency" size="3" placeholder="€">
+<input name="line_4_currency" size="3" value="USD" placeholder="€">
 </td>
 <td colspan="1">
-<input name="line_4_comment" size="40">
+<input name="line_4_comment" size="40" value="">
 </td>
 <td colspan="1">
 <button type="button">add new</button>