ajaxForm and onSubmit

44 views
Skip to first unread message

Tobias Hauth

unread,
Oct 15, 2009, 9:41:03 AM10/15/09
to lif...@googlegroups.com
Hi,

I want to use 'def ajaxForm(onSubmit: JsCmd, body: NodeSeq)' and
update a hidden fields value on submit with some value. The problem is
that the generated javascript for the onsubmit event first executes
the serialize on the form and then uses my code for onSubmit.

E.g. ajaxForm(bind("editor", xhtml, "hidden" -> hidden(updateContent
_, "", ("id", "hidden")), "save" -> submit("Save", () => {})),
SetValById("hidden", Str("This should be the content of hidden"))))

This updates the hidden field value after the submit and updateContent
gets only the old value from the last submit. With a normal form it
works without problems with the update code triggered by onSubmit.

Is there a way to update the hidden field before transferring its value?

Thanks,
Tobias

David Pollak

unread,
Oct 15, 2009, 11:38:15 AM10/15/09
to lif...@googlegroups.com
Sounds like a defect to me.  Please open a ticket.
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
Reply all
Reply to author
Forward
0 new messages