durusmail: quixote-users: beginner request -- javascript sample
beginner request -- javascript sample
2003-05-06
2003-05-07
beginner request -- javascript sample
Andrew Kuchling
2003-05-07
On Tue, May 06, 2003 at 02:36:13PM -0700, Larry Tjoelker wrote:
>Does somebody have a code snippet that includes javascript in
>a quixote form?

Call response.add_javascript(identifier, js_code) to store a chunk of
Javascript. 'identifier' is a short identifying string that's used to
avoid adding multiple copies of the same code; 'js_code' is a string
containing the actual code.  The default Form.render() method will
then add the JavaScript code to the page.

Usually a form widget subclass will add the JS code in its render()
method, something like:

    def render [html] (self, request):
        '