From f0dd16ebfe26e79e069f10ed02970b07a77f4081 Mon Sep 17 00:00:00 2001 From: OctoCat <62594565+lumison@users.noreply.github.com> Date: Mon, 28 Sep 2020 09:46:23 +0300 Subject: [PATCH] Fixed the error with password (#155) * Fixed the error with password * Changed to old style --- examples/login.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/login.nim b/examples/login.nim index f7b9062..0350e23 100644 --- a/examples/login.nim +++ b/examples/login.nim @@ -17,7 +17,7 @@ const proc validateNotEmpty(field: kstring): proc () = result = proc () = let x = getVNodeById(field) - if x.text.isNil or x.text == "": + if x.text == "": errors.setError(field, field & " must not be empty") else: errors.setError(field, "") @@ -27,7 +27,7 @@ var loggedIn: bool proc loginDialog(): VNode = result = buildHtml(tdiv): if not loggedIn: - loginField("Name :", username, "input", validateNotEmpty) + loginField("Name: ", username, "input", validateNotEmpty) loginField("Password: ", password, "password", validateNotEmpty) button(onclick = () => (loggedIn = true), disabled = errors.disableOnError()): text "Login"