我如何在第二次幻灯片中使用价值?
比如,我以下列形式进入年龄:
<div>
<form class="lift:OnSubmit?form=post">
Age: <input name="age" value="0"><br>
<input type="submit" value="Submit">
</form>
</div>
Snippet:
object OnSubmit {
def render = {
var age = 0
// process the form
def process() {
S.notice("Age: "+age)
S.redirectTo("/")
}
}
"name=age" #> SHtml.onSubmit(s => asInt(s).foreach(age = _)) &
"type=submit" #> SHtml.onSubmitUnit(process)
}
}
我怎么能利用另一个幻灯类中的年龄值?
谢谢!
Best regards, John