Thank you. the answer was very clear for me to solve it. one another question is about Bruno's answer about storing data in session using dictionary. I see that appending works for adding new orders but what if you place an order that's already placed in session? I know how to compare one word at a time, but with my knowledge, I don't know how to find if it's same order and increase only the quantity if it finds one. any help? I will try my best to figure it out by tonight though!
Thank you! On Mon, Mar 26, 2012 at 9:12 PM, Anthony <abasta...@gmail.com> wrote: > var data = $('.info input[type=\'text\', ....) >> alert(data) // it shows pid=8&topping=1&topping=3&... on and on >> I have a problem on this line >> How can I send the serialized values by using ajax to the python method? >> This is what I wrote >> ///// >> ajax('{{=URL('tester',vars=**dict(data=data))}}',,box-**content'); >> > > That won't work because dict(data=data) is Python code that is executed > on the server, and "data" is a Javascript variable defined in the client > (after the Python code has already been executed). Anyway, if the values > are in form input elements, the ajax() function will handle the serializing > for you -- you just have to list the names of the input elements as the > second argument: > > ajax('{{=URL('tester')}}', ['pid', 'topping'], 'box-content') > > Anthony > >