From 61e5296fb934593242c9a9eb47cee1fdc37928c6 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 17 Jan 2020 23:06:35 -0700 Subject: [PATCH] Clear number and unit fields when focus gained --- www/assets/js/add.js | 11 ++++++++--- www/pages/add.html | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/www/assets/js/add.js b/www/assets/js/add.js index 6e24bdb..5dc261f 100644 --- a/www/assets/js/add.js +++ b/www/assets/js/add.js @@ -79,9 +79,6 @@ $("#addpackagebtn").click(function () { + ' ' + ''); }); - // Clear out unit value since it's unlikely to - // be used twice - $("input[name=unit]").val(""); }); // Remove any pre-existing click handlers from the history list, @@ -100,6 +97,14 @@ $(".view-main").on("click", "#historylist .history-list-item", function () { }); }); +document.getElementById("housenumberinput").onfocus = function () { + document.getElementById("housenumberinput").value = ""; +} + +document.getElementById("unitinput").onfocus = function () { + document.getElementById("unitinput").value = ""; +} + // Restore user's last entered city/state combo if (inStorage("citystate")) { $("input[name=citystate]").val(getStorage("citystate").replace(/\s*[0-9]{5}$/, "")); diff --git a/www/pages/add.html b/www/pages/add.html index f48ef22..a1e5050 100644 --- a/www/pages/add.html +++ b/www/pages/add.html @@ -43,7 +43,7 @@
Number
- +
@@ -51,7 +51,7 @@
Unit
- +