You cannot nest dtml tags inside another dtml tag, <dtml-var filename<dtml-var sequence-number>> is invalid. Untested: <dtml-var "_[filename+_['sequence-item']]"> Is probably what you want. -- Andy McKay. ----- Original Message ----- From: "servel yannick" <yservel@glam.ac.uk> To: <zope@zope.org> Sent: Wednesday, March 21, 2001 12:12 PM Subject: [Zope] Problem with <input type=hidden value="<dtml-var filenamex>" name =filenamex>
Hi, all
I have a problem, it seems that the syntax:
<input type=hidden value='<dtml-var filename<dtml-var sequence-number>>' name='<dtml-var sequence-number>'>
doesn't work.
This is the file CreateMenu.htnl
CreateMenu.html
<form action="SaveMenu.html" method="post"> <input type=hidden value='<dtml-var nbMenu>' name=nbMenu> <input type=hidden value='<dtml-var nbCol>' name=nbCol>
<dtml-var "CreateTypeMenu(nbMenu=nbMenu, nbCol=nbCol, REQUEST=REQUEST)">
<dtml-var "CreateBegin(REQUEST=REQUEST)"> <tr><td><input type=submit value="ok2"></td></tr> </form>
This is the "CreateTypeMenu" external python method:
def CreateTypeMenu(self, nbMenu=None, nbCol=None, REQUEST=None): s="" nbMenu= int(nbMenu) nbCol = int(nbCol) self.nbTypeMenu = nbMenu self.Col = nbCol return self.Col
And the "CreateBegin" external python method:
def CreateBegin(self, REQUEST=None): Col2 = self.Col Num = self.nbTypeMenu Rows = ((Num) / (self.Col)) Cols = ((Num) % (self.Col)) s = "" i = 0
s = s + "<center><table border = 0>"
while i < Rows: s = s + "<tr>" j = 0 if i == 0: s = s + "<td rowspan = %s>" if Cols == 0: s=s % (Rows) else: s=s % (Rows+1) s = s + "com" s = s + "</td>"
while j < Col2: s = s + "<td>"
s = s + '<input type="file" name="filename%s" VALUE="">' s = s % str(((i*Col2)+j+1))
s = s + "</td>"
j = j + 1
if i == 0: s = s + "<td rowspan = %s>" if Cols == 0: s=s % (Rows) else: s=s % (Rows+1) s = s + "com" s = s + "</td>"
s = s +"</tr>" i = i +1
i = 0 if Cols <> 0: s = s + "<tr><td> </td>" while i < Cols: s = s + "<td>"
s = s + '<input type="file" name="filename%s" VALUE="">' s = s % ((Rows*Col2)+i+1)
s = s +"</td>" i = i + 1
s = s +"</tr>" s = s s = s + "</table></center>" return s
Then the user is returned the SaveMenu.html DTML document:
<dtml-in "_.range(nbTypeMenu)">
<input type=hidden value='<dtml-var filename<dtml-var sequence-number>>' name='<dtml-var sequence-number>'>
</dtml-in> <dtml-var "RAS(REQUEST=REQUEST)">
The problem is it seems that the statement <input type=hidden value='<dtml-var filename<dtml-var sequence-number>>' name='<dtml-var sequence-number>'> is illegal. Is there any alternative to this statement.
Many thanks
Yannick
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )