Hello!

I am having that JavaScript function inside a web2py view:

function submit_form(input_number, input_goal) {
    $('input#user_input_number').val(input_number);
    $('input#user_input_goal').val(input_goal);
    $('form:first').submit();
    return false;
}

I would like to assign the value of input_number to the web2py
session.my_var-variable.

As much as i know, to pass input_number to the session.my_var
variable, first an AJAX call must be made. After that, the value of
input_number could be called from web2py request.vars["input_number"],
for example.
The end result should look like:

function submit_form(input_number, input_goal) {
    $('input#user_input_number').val(input_number);
    $('input#user_input_goal').val(input_goal);
    THE AJAX CALL
    {{session.my_var = request.vars["input_number"]}}
    $('form:first').submit();
    return false;
}

The problem is that i do not know how to make that "THE AJAX CALL"
from inside the web2py view.

Could you please give me examles of such a JavaScript to Python
variable passing?

Reply via email to