Hope this is the right place for my question. I'm trying to update a text
input. Having entered something in "input_1", I'd like to update the text
that's shown in "input_2". With the code shown below, I'd expect "Auto text" to
appear in input_2's text field. But that does not happen.
include karax / prelude
type
Model = object
value_1: string
value_2: string
var model: Model
proc setInput(ev: Event, node:VNode): auto =
model.value_1 = $node.text
model.value_2 = "Auto text"
proc createDom(): VNode =
result = buildHtml(tdiv):
input(id = "input_1", onchange=setInput)
input(id = "input_2", value = model.value_2)
input(id = "input_3", value = "Initial Value")
p: text $model
setRenderer createDom
Run
I'd appreciate any kind of hint for solving my problem. Thanks a lot.