升降机中的文本框验证
如何对用 lift 编写的表单中的文本框执行文本验证? 例如,我有这个表单代码:
def render = ".name" #> SHtml.text(name, name = _) &
".destination" #> SHtml.text(destination, destination = _) &
".phone" #> SHtml.text(phone, phone = _) &
":submit" #> SHtml.onSubmitUnit(() =>
How can I add validating to those text fields?
谢谢
How can I perform a text validation on a textbox in form written in lift?
For example I have this form code:
def render = ".name" #> SHtml.text(name, name = _) &
".destination" #> SHtml.text(destination, destination = _) &
".phone" #> SHtml.text(phone, phone = _) &
":submit" #> SHtml.onSubmitUnit(() =>
How can I add validation to those text boxes?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在传递给
onSubmitUnit
的函数中进行所有验证。 Simply Lift 表单章节有很多很好的表单处理示例。You can make all validations in function that is passed to
onSubmitUnit
. Simply Lift Forms chapter have a lot of nice examples of form processing.