[Zope] dtml-in question

Russell Hires rhires@earthlink.net
Tue, 03 Apr 2001 13:13:38 -0400


Why of course!

I want to create a table of input boxes. The way I wanted to do this was by
creating a row of boxes, then going to the next row and creating ten more
boxes.

In the course of writing this, I couldn't remember what I had originally
done that didn't work. But in trying to duplicate it, it does work now:

<table>
<dtml-in "_.range(10)"> 
  <tr> 
  <dtml-in "_.range(10)">
   <td><form>
   <input type=text name="foo" size=3>
  </dtml-in>
 </dtml-in>
 </table>

Of course, at this point, using this code, I have 100 input boxes with the
same name. How do I introduce a counter that will give me 100 different
names for the boxes (or whatever number of boxes the user wants to create)?

Thanks for your help.

Russell
____________________________________________________
  _its_ (no apostrophe) means "the thing that it owns"
  _it's_ (with apostrophe) means "it is"


----------
>From: "Phil Harris" <phil.harris@zope.co.uk>
>To: "Russell Hires" <rhires@earthlink.net>, <zope@zope.org>
>Subject: Re: [Zope] dtml-in question
>Date: Tue, Apr 3, 2001, 10:17 AM
>

> Nesting dtml-in is very possible.
>
> I don't quite get from your explanation what your trying to do though.
>
> Could you elucidate slightly.
>
> Phil
>
> ----- Original Message -----
> From: "Russell Hires" <rhires@earthlink.net>
> To: <zope@zope.org>
> Sent: Tuesday, April 03, 2001 3:08 PM
> Subject: [Zope] dtml-in question
>
>
>> Is it possible to nest <dtml-in> tags?
>> Actually, I know it isn't because that's something I've tried already and
> it
>> didn't work. At least, it didn't work the way I tried it.
>>
>> I'm just getting my feet wet with dtml, and I created a table using one
> dtml
>> method to create one row of the table using the <dtml-in> tag, but it
> seems
>> silly to have to have a completely separate method for one <tr> tag in a
>> method all by itself.
>>
>> I did solve the problem this way: I created one method with the definition
>> of one row of a table, then created another method with one <tr> tag to
>> create the next row of the table, then looped using <dtml-in> first-method
>> second-method</dtml-in>. It just seems kinda klunky...
>>
>> Thanks for any help!
>>
>> Russell
>