dtml-if and _.['sequence-item']
Hi everyone, I canot get this example from the zope bible to work. Any ideas anyone?? I am calling the form with a value for month in the namespace so that's not the problem: <SELECT name="month"> <dtml-in "('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')"> <OPTION <dtml-if expr="month == _.['sequence-item']">SELECTED</dtml-if>value="<dtml-var sequence-item>"><dtml-var sequence-item></OPTION> </dtml-in> </SELECT> TIA Marie Robichon Web Task Force European Synchrotron Radiation Facility BP 220 38043 Grenoble Cedex France Tel: (33) 04 76 88 21 86 Fax: (33) 04 76 88 24 27
Marie Robichon wrote:
I canot get this example from the zope bible to work. Any ideas anyone?? I am calling the form with a value for month in the namespace so that's not the problem:
<SELECT name="month"> <dtml-in "('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')"> <OPTION <dtml-if expr="month == _.['sequence-item']">SELECTED</dtml-if>value="<dtml-var sequence-item>"><dtml-var sequence-item></OPTION> </dtml-in> </SELECT>
Can you explain, WHAT happens exactly? Would be much easier to track down your problem, if I know what's going wrong... -mj
On 18/11/02 4:32 pm, "Marie Robichon" <robichon@esrf.fr> wrote:
Hi everyone,
I canot get this example from the zope bible to work. Any ideas anyone?? I am calling the form with a value for month in the namespace so that's not the problem:
<SELECT name="month"> <dtml-in "('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')"> <OPTION <dtml-if expr="month == _.['sequence-item']">SELECTED</dtml-if>value="<dtml-var sequence-item>"><dtml-var sequence-item></OPTION> </dtml-in> </SELECT>
Ugh. That's a bit messy. Neater to do: <SELECT name="month"> <dtml-in "('Jan', 'Feb', 'Mar')" prefix=month> <OPTION <dtml-if "month_item == month">SELECTED</dtml-if> value="<dtml-var month_item>"><dtml-var month_item></OPTION> </dtml-in> </SELECT> The error in your code is instead of _.['sequence-item'] it needs to be _['sequence-item'] There's a couple of other errors in examples in the Zope Bible so mail the list again if you get stuck. A -- Logical Progression Ltd, 3 Randolph Crescent, Edinburgh, EH3 7TH, UK Tel: +44 (0)131 466 9585 Web: http://www.logicalprogression.net/
participants (3)
-
Andrew Veitch -
Maik Jablonski -
Marie Robichon