passing ZPT variables to Javascript
If I defined variables in my ZPT using tal:define, how do I pass these variables to a javascript function without getting an error? My attempt (obviously wrong): <td tal:define="itemId item/id; code item/code"> <a style="color:dodgerblue" tal:define="url string:${request/URL1}/processDeleteItem?itemId:int=$itemId&code=$code" href="javascript:doNothing()" onClick="javascript:confirmDelete('string:$code', 'string:$url')"><img src="/ItemManager/images/delete_icon" border="0"></a> </td> Thanks, Karen --------------------------------- Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com
Karen Yang schrieb:
If I defined variables in my ZPT using tal:define, how do I pass these variables to a javascript function without getting an error?
My attempt (obviously wrong): <td tal:define="itemId item/id; code item/code"> <a style="color:dodgerblue" tal:define="url string:${request/URL1}/processDeleteItem?itemId:int=$itemId&code=$code" href="javascript:doNothing()" onClick="javascript:confirmDelete('string:$code', 'string:$url')"><img src="/ItemManager/images/delete_icon" border="0"></a> </td>
Thanks,
Karen
------------------------------------------------------------------------ Do you Yahoo!? Faith Hill <http://faith.yahoo.com> - Exclusive Performances, Videos, & more faith.yahoo.com <http://faith.yahoo.com>
Try it with tal:attributes, hera an example: <a href="#" tal:define="code string:codeString; url string:urlString" tal:attributes="onClick string: javascript:alert('code: ${code} \nurl: ${url}')"
foo</a>
Tonico -- Contact me mailto:contact_tonico@yahoo.de Visit my HomePage http://tonico.freezope.org __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Yahoo! pr�sentiert als offizieller Sponsor das Fu�ball-Highlight des Jahres: - http://www.FIFAworldcup.com
participants (2)
-
Karen Yang -
Tonico Strasser