From ff3a465981cc6dbeb7ed88b50f189745067fb6fe Mon Sep 17 00:00:00 2001 From: Justin Date: Sat, 11 Jun 2022 23:57:23 +0800 Subject: [PATCH] Update app.js --- static/app.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/static/app.js b/static/app.js index 15b4503..486ade4 100755 --- a/static/app.js +++ b/static/app.js @@ -1647,3 +1647,33 @@ function showWeatherP() { } +// Disable adding cities when no API key detected + + + if(document.getElementById("api-key1").value==="") { + document.getElementById('inputTextBtn6').disabled = true; + } + + else if (document.getElementById("api-key1").value==="Weather API Key") { + document.getElementById('inputTextBtn6').disabled = true; + } + + else { + document.getElementById('inputTextBtn6').disabled = false; + } + + + + + if(document.getElementById("api-key").value==="") { + document.getElementById('inputTextBtn7').disabled = true; + } + + else if (document.getElementById("api-key").value==="Weather API Key") { + document.getElementById('inputTextBtn7').disabled = true; + } + + else { + document.getElementById('inputTextBtn7').disabled = false; + } +