|laziness, impatience, and hubris|
Oh wise and patient brethren,
I haven't had to do any HTML/CGI development in many a moon (oh, 10 years or so). I have a new project which gave me an opportunity to try some new things, so I'm playing with Catalyst and Template Toolkit. Very cool stuff I must say.
Let's assume for the sake of argument that there's a form where users can enter lists of books and authors. There's no limit to the number they can enter, and there's no way for me to know how many they will want to enter. So what I want it a way to dynamically add more fields with a button(?)
My head was firmly mired in Catalyst/TT, so my first effort was:
Where in new_request.tt2 I have:
That worked fine, and allowed me to control the number of fields in my form_create() routine. What I wanted to do then was add a way to the form to increment the entry_fields and regenerate the form. When I got to that point, I realized I didn't have a clue what to do
So maybe I'm thinking orthogonal to the problem, but I'm not sure how to proceed...any pushes in the right direction are appreciated.
PS: Yes, I'm aware the answer here may have nothing to do with perl, Catalyst, or TT, so try and be gentle please.