Your code intercepts the form submission but doesn't actually submit the form data. You'll either have to extract the value from the form and add it to the Ajax URL query string (using Javascript, not Python), or use Javascript to serialize and submit the form via Ajax. You could make things a lot easier by putting the form in an Ajax component, which will automatically get submitted via Ajax.
Anthony On Friday, May 12, 2017 at 2:55:46 AM UTC-4, sunda.am...@gmail.com wrote: > > But this request.vars.category, i have to ryt it in the view and then pass > it to then action via my script, or i directly write it on the action ? > Because in both case, the value he show is none ... > > Le jeudi 11 mai 2017 15:51:36 UTC+2, sunda...@gmail.com a écrit : >> >> Hello, >> >> >> Normally and in a lot of tutorials i see the declaration of a form inside >> the controller and onlly {{=form}} inside the view .... Sadly i am working >> in a big website with hundred files and they did like the declaration of >> the form with Helpers inside the view. SO, the problem is that when i >> submit i want the value i putted inside a form. and Thanks to the ajax ( >> this part is working and already done ) i will pass it to the controller. >> So the main question is : >> >> {{ >> >> =FORM(INPUT(_name='category',_value='Category'),INPUT(_type='submit',_value='submit'),_id='categ') >> }} >> >> >> <script> >> jQuery('#categ').submit(function() { >> ajax('{{=URL('categ',vars=dict(value=WAITING FOR THE VALUE))}}'); >> return false; >> }); >> </script> >> >> How do i get the value of the form catefory >> >> PLZ HELP MEEE >> > -- 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.