[Zope] variable length forms...

zope zope@isp.lu
Tue, 07 Nov 2000 10:55:11 +0100


Hi.

I have tried to implement a variable length form.

Yes, I have read 
http://www.zope.org/Members/jpenny/variable_length_forms/index_html.!

I a form, I'm using following form fields:

<dtml-in "_.range(1, _.string.atoi(form_numpages)+1, 1)">
	<tr align="center" valign="middle">
		<td><dtml-var sequence-number></td>
		<td><input type="text" name="form_time_out" size="6" maxlength="4"></td>
		<td><input type="radio" name="radiob<dtml-var sequence-number>"></td>
		<td><input type="radio" name="radiob<dtml-var sequence-number>"></td>
	</tr>
</dtml-in>

where form_numpages is a variable that i got from a previous form.
This form works fine and generates me form_numpages lines with always one 
textfield and a group of 2 radiobuttons named per line.

form_time_out  radiob1   radiob1
form_time_out  radiob2   radiob2
form_time_out  radiob3   radiob3
...

The contents of this form is submitted and I want to interpret the data 
with following method:

1: <dtml-in "_.range(1, _.string.atoi(form_numpages)+1, 1)">
2:	<dtml-var sequence-number>:
3:	<dtml-var "_['radiob'+_['sequence-number']]">
4: </dtml-in>

This returns the following Zope error:

Error Type: TypeError
Error Value: illegal argument type for built-in operation

If I'm replacing the third line with <dtml-var "_['sequence-number']">, the 
sequence-number is printed out. So I'm sure that it exits.

How can I get the contents of radiob1, radiob2, radiob3, ...

Thanks a lot for your help!

Marc Ludwig