Fernando Lujan wrote:
Hi,
I have a array data type in my DB wich have the following format :
{1,2,3} ( ids_test ). Now in my web application, I have a multiple
select wich options must be marked as selected if the number is in the
array described above. How can I make the above format be converted to
a list of elements?
For instance:
<html>
<body>
<dtml-in searchIdsTest>
<dtml-call "REQUEST.set('ids_test', '['+ids_test[1:-1]+']')">
</dtml-in>
<form>
<select name="id_test" multiple="true">
<dtml-in serch_id_test>
<option value="&dtml-id_test;" <dtml-if id_test in
ids_test> selected="true"</dtml-if>></option>
</dtml-in>
</select>
</form>
</body>
</html>
Thanks.
Fernando Lujan
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
Fernando,
I think you are close. Change <dtml-if ids_test in ids_test> to
<dtml-if "ids_test in ids_test"> ?
David
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )