Hello All, I have the following bit of code that loops through and creates a radio button for every folder. I would like the value of the radio button to be the title of the folder. How do I do that? That code below does not work -- it uses the actual name 'foldersName' as the value of the radiobutton not the title of the folder. Thanks!! <table class="normal"> <tr> </tr> <tr valign="top" align="left" tal:repeat="folders python:here.objectValues('Folder')"> <th tal:define="foldersName folders/title" tal:content ="foldersName">Title</th> <td><input type="radio" name="release" value=foldersName></td> </tr> </table>
you have to use tal:attributes <input type="radio" name="release" tal:attributes="value foldersName"></td> Robert ----- Original Message ----- From: <Rebecca.R.Hepper@seagate.com> To: <zope@zope.org> Sent: Tuesday, June 25, 2002 8:55 PM Subject: [Zope] Value of radio button
Hello All,
I have the following bit of code that loops through and creates a radio button for every folder. I would like the value of the radio button to be the title of the folder. How do I do that? That code below does not work -- it uses the actual name 'foldersName' as the value of the radiobutton not the title of the folder.
Thanks!!
<table class="normal"> <tr> </tr> <tr valign="top" align="left" tal:repeat="folders python:here.objectValues('Folder')"> <th tal:define="foldersName folders/title" tal:content ="foldersName">Title</th> <td><input type="radio" name="release" value=foldersName></td> </tr> </table>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Change this line: <input type="radio" name="release" value=foldersName> to: <input type="radio" name="release" value="" tal:attributes="value foldersName"> hth Phil On Tue, 25 Jun 2002 13:55:22 -0500 Rebecca.R.Hepper@seagate.com wrote:
Hello All,
I have the following bit of code that loops through and creates a radio button for every folder. I would like the value of the radio button to be the title of the folder. How do I do that? That code below does not work -- it uses the actual name 'foldersName' as the value of the radiobutton not the title of the folder.
Thanks!!
<table class="normal"> <tr> </tr> <tr valign="top" align="left" tal:repeat="folders python:here.objectValues('Folder')"> <th tal:define="foldersName folders/title" tal:content ="foldersName">Title</th> <td><input type="radio" name="release" value=foldersName></td> </tr> </table>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Rebecca.R.Hepper@seagate.com writes:
.... <table class="normal"> <tr> </tr> <tr valign="top" align="left" tal:repeat="folders python:here.objectValues('Folder')"> <th tal:define="foldersName folders/title" tal:content ="foldersName">Title</th> <td><input type="radio" name="release" value=foldersName></td> </tr> </table> Others already told you about the "tal:attributes" in the "input" tag.
You will need a second modification: The "tal:define" in "th" is local. The definition disappears as soon as you leave the "th" element. Either use "global foldersName" or add an additional (artificial) tag around both "th" and "td" and give it the definition. You may use "tal:dummy" (or another tag in the "tal" namespace). As an element in the "tal" namespace, there will be not tags rendered. Dieter
participants (4)
-
Dieter Maurer -
Phil Harris -
Rebecca.R.Hepper@seagate.com -
Robert Rottermann