[web2py] Re: ajax:whats wrong with this

2011-05-06 Thread pbreit
I'd like to help but am extremely confused by your code and what you are trying to do. I would reiterate trying to start simply, get it to work and then add more complexity. And try to make your code look like code found in the book. It makes it a lot easier for us to understand. http://web2py.

[web2py] Re: ajax:whats wrong with this

2011-05-06 Thread Resa
the problem is that its in the javascript..(in the view) the url is not goin to work.. and teh ajax is not workin.. the problem is that i need all teh scripts to run in a sequential order and the ajax or javascript is actually the last on to run so thats why i placed the the function in a javascri

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread pbreit
Get something simple working and then add complexity.

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread Anthony
On Friday, May 6, 2011 12:02:54 AM UTC-4, Resa wrote: > > ok cool.. understood.. so how would i send variables to a function in > the controller? You could pass them via the URL query string. The best way to do that is to use the URL function to create the URL -- see http://web2py.com/book/d

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread Resa
ok cool.. understood.. so how would i send variables to a function in the controller? On May 5, 10:49 pm, Anthony wrote: > ajax('{{=URL('insert_updatedb')}}', > ['numBer','mgp','total_time','correct'],''); > > The above will not send the values of your variables as request variables. > The list s

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread Anthony
ajax('{{=URL('insert_updatedb')}}', ['numBer','mgp','total_time','correct'],''); The above will not send the values of your variables as request variables. The list submitted to the ajax() function is supposed to be a list of field IDs (see http://web2py.com/book/default/chapter/10#The-ajax-F

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread Resa
I am having huge issues with the parameters cause they are not being sent to the function at all... def insert_updatedb(): session.correct=request.vars.correct session.numquest=request.vars.number session.time_quest=request.vars.total_time session.mgp=request.vars.mgp . . . On May

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread Resa
Correction: function MGP(correct) { var time_per_question=2; //2 second to answer one question var numBer={{=request.vars.number}}; // the number of questions in worksheet var bonus= (numBer<20)? 1: (numBer<40)? 3 :(numBer<60)? 7: (

[web2py] Re: ajax:whats wrong with this

2011-05-05 Thread pbreit
This is pretty confusing code. I'm not sure how these assignments are going to work: {{=numBer}}=numBer ... Normally you have something like num={{=row.num}} In the dict() it looks like you are assigning strings. Normally it would look more like this dict(numBer=numBer,...) You definitely don'