Well putting an id to the hidden field allows you to manipulate it via
JavaScript.

Br's,
Marius

On Apr 6, 5:01 pm, wapgui <[email protected]> wrote:
> Hi,
>
> is there an equivalent in lift to the hidden input filed used in
> forms. The SHtml.hidden is only for functions not for parameters, the
> value is always true. I want set the hidden input via javascript.
>
> Is there also a parameter for setting the name of the form itself?
>
> Here the code:
>
> object smlink extends RequestVar(Full(""))
>
> var fp = new Widget()
>
>   def show(xhtml: NodeSeq): NodeSeq = {
>     val temp =
>       if (smlink.isEmpty || smlink.open_!.length == 0) "" else
> "Received: " + smlink.open_!
>
>     bind("fp", xhtml,
>       "color" -> hidden({() => fp.color}),
>       "title" -> text(fp.title, fp.title = _) % ("size" -> "10") %
> ("id" -> "title"),
>       "url" -> text(fp.url, fp.url = _) % ("size" -> "56") % ("id" ->
> "url"),
>       "items" -> select((1 to 9).toList.reverse.map(v => (v.toString,
> v.toString)),
>                         Empty, fp.items = _),
>       "submit" -> submit("Send", () => {
>         Log.info("Submitted ")
>         smlink(Full(fp.title))
>       }),
>       "link" -> <div>{temp}</div>
>     )
>   }
>
> generates this:
>
> <form method="post" action="/">
>         <input name="F1142516722376UOU" type="hidden" value="true" /><br />
>         <label for="title">Title</label>
>         <input size="10" name="F1142516722377UCO" type="text" value=""
> id="title" /><br />
>         <label for="url">URL</label>
>         <input size="56" name="F1142516722378IZS" type="text" value=""
> id="url" /><br />
>         <label for="items">Items</label>
>         <select name="F1142516722379K2S"><option value="9">9</
> option><option value="8">8</option><option value="7">7</option><option
> value="6">6</option><option value="5">5</option><option value="4">4</
> option><option value="3">3</option><option value="2">2</option><option
> value="1">1</option></select><br />
>         <input name="F1142516722380W2M" type="submit" value="Send" />
>         <div></div>
>         </form>
>
> Cheers
> Torsten
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to