I was attempting to implement the simple form validation javascript
example from Exploring Lift and ran into an error.
I have posted below the working bind that I commented out and the
error causing bind that was my failed attempt at implementing the
validation javascript.
bind("test", xhtml,
"blog_title" -> SHtml.text(blog_title, blog_title = _, "id" -
> "blogtitle"),
"submit" -> SHtml.submit("Post", newBlog, "onclick" ->
JsIf(JsEq(ValById("blogtitle"), ""),
Alert("You must provide a value") & JsReturn(false))))
/*
bind("test", xhtml,
"blog_title" -> SHtml.text(blog_title, blog_title = _),
"submit" -> SHtml.submit("Post", newBlog))
*/
I received a "type mismatch" error that stated
[INFO] found : (String, net.liftweb.http.js.JsCmd)
[INFO] required: net.liftweb.http.SHtml.ElemAttr
[INFO] "submit" -> SHtml.submit("Post", newBlog, "onclick" ->
JsIf(JsEq(ValById("blogtitle"), ""),
I understand that the third parameter is suppose to be an ElemAttr but
I was just following the example and don;t really know where to go
next since I am just starting..
http://exploring.liftweb.net/master/index-10.html#toc-Section-10.1
I have been playing around with Scala/Lift for around a month and have
made some assumptions that I would like to confirm.