: 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
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.
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
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
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.
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
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