On Mon, Aug 10, 2009 at 4:13 AM, fricke <[email protected]> wrote:
> > > thanks for the tip; Sure thing. > > it's way nicer than what I did: give the element an ID and then use > this one for the focus But if you've already given the element an id, it used that one. > > > thanks > markus > > On Aug 10, 12:15 am, David Pollak <[email protected]> > wrote: > > On Sat, Aug 8, 2009 at 9:19 AM, fricke <[email protected]> wrote: > > > > > Hi all, > > > > > currently I have the following simple problem: I want to set the focus > > > to a specific field, > > > using > > > <script type="text/javascript"> > > > document.myform.myfield.focus(); > > > </script> > > > > > The Scenario: a simple bind("user", form, "name" -> SHtml.text(x, x = > > > _) ) > > > > Try: > > > > import net.liftweb.http.js.JsCmds._ > > > > Then: > > > > bind("user", form, "name" -> FocusOnLoad(SHtml.text(x, x =_) )) > > > > > > > > > > > > > with > > > <lift:UserLogin.login form="POST"> > > > User Name: <user:name/> > > > </lift:UserLogin.login> > > > > > Here I come into trouble since > > > (i) I cannot tell lift what the name of the form is (I tried > > > <lift:UserLogin.login form="POST" name="myform">, > > > but this didn't work (I alternatively tried the namespaces lift: and > > > the one used in the binding) > > > (ii) additionally, I couldn't retrieve (or alternatively define) the > > > name of the generated ID - the one used in the input field "name" (I > > > tried to overwrite it in the HTML - via user:name="myfield" - but this > > > wasn't reflected in the backend, so the value never arrived there > > > ----- I also tried to add attributes in the call of the bind method > > > => same behaviour). > > > > > In the "getting started" it's mentioned that you can overwrite the > > > generated form names etc - but I couldnt find a way to do so. I would > > > even be happier with a way to retrieve the internal name of a > > > SFuncHolder (ot keep these nice random values) > > > > > ah btw. I'm using the latest snapshot > > > > > thanks and regards > > > Markus > > > > -- > > Lift, the simply functional web frameworkhttp://liftweb.net > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > Follow me:http://twitter.com/dpp > > Git some:http://github.com/dpp > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
