[EMAIL PROTECTED] schrieb: > I'm trying to implement a checkbox using TG 1.0.4b2 with Genshi. > > Here's the relevant line in my template: > > <input type="checkbox" name="red" checked="tg.checker()" />RED<br /> > > No matter what I put inside the parentheses for tg.checker, the box > always ends up checked. Even when (as shown above) I put in > nothing...which I assume should definitely be false, right? > > Here's the relevant source fed to my web browser: > <input type="checkbox" name="red" checked>RED<br> > > What am I doing wrong? > > Is there a better way to do this?
The "checked" alone will suffice to make the browser render it. So instead you need to do it like this: <input py:if="tg.checker()" checked="true" ... /> <input py:if="not tg.checker()" ... /> Annoying, but stems from the fact that in HTML the "checked" alone is sufficient for rendering the checkbox selected... Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

