This thread http://groups.google.com/group/liftweb/browse_thread/thread/9d333465ca18eb15/47cac2543737dcb9?lnk=gst&q=ajax+form#47cac2543737dcb9 I believe discusses the same problem you're seeing. Use a hidden field that binds checkAndSave function. There is an alternative approach that I described in the thread I paste.
Br's, Marius On Dec 23, 4:50 pm, Adam Warski <[email protected]> wrote: > Hello, > > > object MyMarkupVar extends RequestVar[NodeSeq](NodeSeq.empty) > > ah, that's much better then my solution. Thanks! :) > > Maybe you could also write, how to submit a whole form using AJAX? :) So far > my attempts are futile. > I get an ajax request, but the value of the field isn't bound to the model. > > Code of my snippet, without ajax (works): > bind("todo", chooseTemplate("addForm", "form", form), > "desc" -> todo.desc.toForm, > "submit" -> submit("New", checkAndSave)) > ) > > With ajax (doesn't work): > ajaxForm( > bind("todo", chooseTemplate("addForm", "form", form), > "desc" -> todo.desc.toForm, > "submit" -> submit("New", checkAndSave)) > ) > > Or: > bind("todo", chooseTemplate("addForm", "form", form), > "desc" -> todo.desc.toForm, > "submit" -> ajaxButton("New", () => {checkAndSave; reDraw()})) > ) > > -- > Adam -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
