Re: [PHPTAL] Selected attribute in select list

2009-04-29 Thread Matt Marron
: Julian Haupt julian.ha...@hauptmedia.de Subject: Re: [PHPTAL] Selected attribute in select list To: phptal@lists.motion-twin.com Message-ID: 1240915543.9147.27.ca...@superwash-2000 Content-Type: text/plain Hi, The way you USA should work, but try this: tal:block tal:repeat=c categories option

Re: [PHPTAL] Selected attribute in select list

2009-04-28 Thread Julian Haupt
Hi, The way you USA should work, but try this: tal:block tal:repeat=c categories option tal:attributes=value c/id;selected php: f.categoryid == c.id tal:content=c/category/option /tal:block In general it might be a bad idea to use php code and explicit comparisons in the templates.

Re: [PHPTAL] Selected attribute in select list

2009-04-28 Thread Julian Haupt
Hi, Am Dienstag, den 28.04.2009, 12:41 +0100 schrieb Kornel LesiƄski: On 28-04-2009 at 11:45:43 Julian Haupt julian.ha...@hauptmedia.de wrote: tal:block tal:repeat=c categories option tal:attributes=value c/id; selected condition: c.active| string:selected|not:true

Re: [PHPTAL] Selected attribute in select list

2009-04-28 Thread Matt Marron
Tried that, it doesn't work (sets every option as selected). - Original Message - From: Daniel Lima To: Matt Marron ; Template Attribute Language for PHP Sent: Monday, April 27, 2009 5:29 PM Subject: Re: [PHPTAL] Selected attribute in select list The way you USA should

[PHPTAL] Selected attribute in select list

2009-04-27 Thread Matt Marron
I have been trying to figure out how to get the selected option to properly show up in a select list all day with no success. It either shows up on none of the option tags or on all of them. I've posted the relevant code below. What am I doing wrong? Let me know if you need more information.

Re: [PHPTAL] Selected attribute in select list

2009-04-27 Thread Daniel Lima
The way you USA should work, but try this: tal:block tal:repeat=c categories option tal:attributes=value c/id;selected php: f.categoryid == c.id tal:content=c/category/option /tal:block Daniel Lima Web Developer ___ PHPTAL mailing list

Re: [PHPTAL] Selected attribute in select list

2009-04-27 Thread Bobby
Also, take care to sanitize $id, you could be opening yourself to SQL Injection attacks. http://imgs.xkcd.com/comics/exploits_of_a_mom.png Bobby On Mon, Apr 27, 2009 at 3:03 PM, Matt Marron mmar...@zaissco.com wrote: I have been trying to figure out how to get the selected option to