[Petal] decode: help

Josh Narins josh at narins.net
Fri Sep 23 17:11:35 BST 2005


What exactly is it supposed to mean, the phrase "decode:" ?

I also don't have it working as advertised. Not sure whether it is a bug
or not.

extra = 
  [
   {
    c=>1,
    short=>'One Thing',
    selected=>'selected',
   },
   {
    c=>2,
    short=>'Another',
   }
  ]

<select name="c">
  <option petal:repeat="e extra" petal:content="e/short" 
          petal:attributes="value e/c; 
                         selected decode: e/selected 'selected' 'selected'" />
</select>

The selected attribute is correct for c=1, but I get selected="0" for
c=2. That doesn't seem right.

Thanks in advance,
Josh


More information about the Petal mailing list