Hello,

i'm trying to call a javascript function from a submenu item and having 
some troubles with this.

Calling javascript from a level 1 menu works just fine, like this:

response.menu = [
    (T('File'), False, URL(), [
        (T('New'), False, URL('project', 'create'), [])
    ]),

    (A('click me',_onclick="alert('hello')"),None,None)
    
]


However, if i try moving the second menu item to a level 2 section like 
this:

response.menu = [
    (T('File'), False, URL(), [
        (T('New'), False, URL('project', 'create'), [])
    ]),

    (T('View'), False, URL() , [
        (A('click me',_onclick="alert('hello')"),None,None)                 
            
                             ])
    
]


The function does work, but after showing the alert box, the browser is 
redirected to http://localhost:8000/undefined

My Firefox console window shows:

[11:46:30.410] Empty string passed to getElementById(). @ 
> http://localhost:8000/Isidor/static/js/jquery.js:3
> [11:46:30.568] GET http://localhost:8000/undefined [HTTP/1.1 404 NOT FOUND 
> 1ms]
>

Any ideas at what i'm doing wrong?

Jaap

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to