added a getInputText API, cleaner and more robust than the .text attribute which is often updated too late in event handlers after a redraw
This commit is contained in:
parent
24a037ad19
commit
9a627985d0
4 changed files with 8 additions and 4 deletions
|
|
@ -250,8 +250,8 @@ captures the ``field`` parameter:
|
|||
|
||||
proc validateNotEmpty(field: kstring): proc () =
|
||||
result = proc () =
|
||||
let x = getVNodeById(field)
|
||||
if x.text.isNil or x.text == "":
|
||||
let x = getVNodeById(field).getInputText
|
||||
if x.isNil or x == "":
|
||||
errors.setError(field, field & " must not be empty")
|
||||
else:
|
||||
errors.setError(field, "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue