[Zope] tal:attributes and onClick

J Cameron Cooper zope-l at jcameroncooper.com
Mon Oct 4 15:11:03 EDT 2004


Laura McCord wrote:
> The following code performs an expansion using the onClick. 
> 
>   <a href="#" tal:attributes="onClick string:expandIt('${resString}');;
> return false;">
>           <IMG NAME="imEx" SRC="triUp2.gif" WIDTH=15 HEIGHT=15 BORDER=0
> ALT="Expand/Collapse Item">
>   </A>
> 
> Is there a way to add a tal:define on an onclick also? I need to define
> the following: tal:define="info python:here.userInfo(username)" but I
> want it defined in the on onclick as well.

A TAL define statement, as you can see in the order of operations 
section of the docs, is in scope for other statements in the same element.

In other words, you can do your define and simply use 'info' in your 
attributes statement. Are you experiencing anything else?

		--jcc


More information about the Zope mailing list