[web2py] Re: executing javascript after accepting a form

2012-03-27 Thread Sushant Taneja
Hi, If you are submitting your form via ajax then you can use eval to call a JS function. You can check out the syntax here : http://web2py.com/books/default/chapter/29/11#Eval-target create a JS function showDialog(){ // write code here } in the controller write the return statement as :

[web2py] Re: executing javascript after accepting a form

2012-03-27 Thread Anthony
Yes, response.js only works for requests for components (made via a client-side call to web2py_ajax_page(), which is called when you use the LOAD helper in the view). You might try something like this: def index(): ... if form.accepts(request.vars): js = SCRIPT('$(function()

Re: [web2py] Re: executing javascript after accepting a form

2012-03-27 Thread José Luis Redrejo Rodríguez
It works perfectly. Thanks very much Anthony. Sushant: I didn't want to change my code to an ajax form. I wanted to keep it the way it was. Thanks for your suggestion anyway. Regards. 2012/3/27 Anthony abasta...@gmail.com: Yes, response.js only works for requests for components (made via a