Hi,

I am using a flag "isSelcted" with a boolean value to mark my selected option.
The PHP array looks like:

$options = array(
   array(
      'label' => 'Option1',
      'value' => 1
   ),
   array(
      'label'      => 'Option2',
      'value'      => 2,
      'isSelected' => true
   ),
   array(
      'label' => 'Option1',
      'value' => 2
   )
);


My template looks like:

<select>
   <option tal:repeat="option options" tal:attributes="value option/value; 
selected option/isSelected | nothing" tal:content="option/label"/>
</select>

But the output will look like:

<select>
   <option value="1">Option1</option>
   <option value="2" selected="1">Option2</option>
   <option value="3">Option3</option>
</select>

I expected it will look like:

<select>
   <option value="1">Option1</option>
   <option value="2" selected="selected">Option2</option>
   <option value="3">Option3</option>
</select>

What's the problem?


-- 
Regards,
Igor



_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to