[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
You're doing it right, but there are a couple of things to keep in mind. Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but that's merely preference. The other thing you should know is that if a web2py ticket is generated during an AJAX call, you will not know about

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Vasil Petkov
On Jul 8, 3:02 pm, Ross Peoples ross.peop...@gmail.com wrote: You're doing it right, but there are a couple of things to keep in mind. Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but that's merely preference. The other thing you should know is that if a web2py

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
Going from web2py - JavaScript is easy: {{=var}} However, going from JavaScript - web2py requires an AJAX call. Since JavaScript is run on the user's machine and not the web server, the two machines have to communicate somehow, which is where AJAX comes in. You should also know that things

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread ron_m
You need to have the AJAX URL formed in a way that invokes a controller. eg /application_name/controller_name/function_name/arg0/arg1 . and include the variable(s) you want to send back. The variables can be either addition items after the function as above where they show up as args or if

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-07 Thread Vasil Petkov
I tried the following: function submit_form(input_number, input_egn) { $('input#user_input_number').val(input_number); $('input#user_input_egn').val(input_egn); $.ajax({ url: http://127.0.0.1:8000/games/xs-software/vaucher.html;, method:

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-07 Thread Vasil Petkov
On Jul 7, 9:47 pm, Vasil Petkov petko...@dir.bg wrote: I tried the following:     function submit_form(input_number, input_egn) {         $('input#user_input_number').val(input_number);         $('input#user_input_egn').val(input_egn);         $.ajax({                 url: