Yes, but I guess you need to pass it like that :

**{'*_onclick*': *"var reason=prompt('Reason for extending?'); return
reason;"*}

Richard


On Wed, Jul 16, 2014 at 8:09 PM, <ucm...@gmail.com> wrote:

> Hi all,
>
> I started using web2py a week ago with little MVC experience.  I have a
> page displaying a database table using a SQLFORM.grid() where each row has
> buttons to extend a time variable or delete the row.  I want to add a
> pop-up prompt which asks the user why they are extending the time variable.
>
> My links in the controller displaying the database:
>     ## instantiate row variable with database output
>
>     links = [{'header': '', 'body': lambda row: A('extend',
>                                                   _class='btn',
> *                                                  _onclick="var
> reason=prompt('Reason for extending?'); return reason;",*
>                                                   _href=URL('extend',
> args=[row.project_name, row.kill_date]))},
>              {'header': '', 'body': lambda row: A('kill',
>                                                   _class='btn',
>                                                   callback=URL('kill',
> args=[row.project_name]),
>                                                   delete="tr")}]
>
>     grid = SQLFORM.grid(...., links=links, ...)
>     return dict(form=grid)
>
> My view:
> {{extend 'layout.html'}}
> {{=form}}
>
> When I press the extend button, the prompt comes up and I can enter a
> string.  Where does that string go to and how do I access it so that I can
> use it in the 'extend' controller?  Is there a different way I should be
> doing this?
>
> Thanks,
> Jimmy
>
> --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to