Hi

Their is a sample called todolist, find it and try it, it do what you
want.
It let you add as many text field as you want by simply clicking tha
Add button (IF I REMEMBER WELL)


If I had to do it myself , I would have done that way :

first had a block in the template

<div id="next_field_gos_here">here</div>

write a function that use swapDOM to replace this block by a modified
clone of itself like that

swapDOM("next_field_gos_here", DIV({"class": "a_new_block", "I just
arrived!"}, DIV({"id": "next_field_gos_here"}, "here")));

look the DOM documentation of Mochikit for more info




On 10 fév, 19:57, "Chris Miles" <[EMAIL PROTECTED]> wrote:
> Hi!  I have a need for a form with a variable number of text fields.
> For example, the form may start with one text field, and if the user
> wants to add more values, they click on "+"  and another text field is
> dynamically created below the first (with javascript) and so on.
>
> Is there a widget floating around that already handles this use case
> nicely?  (I've scanned cogbin and PyPI already, but can't see anything
> that would do it).
>
> If not, any tips on the best way to implement this?  I know how to
> build basic widgets and forms, but haven't tried to handle a form
> where there would be an unknown number of submission fields.
>
> Cheers,
> CM


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to