Massimo, nice, but in this case, if I were the developer, I would
prefer the javascript countdown timer I recommended. The reason is
that it will create a customizable display that shows a dynamic
countdown clock. This can be tucked away in some part of the page that
the user can see while taking the test, so the user knows how much
time is left before the test taking is over. I built exactly this kind
of app for a Kaplan-like test-drilling company and it worked great.
The app allows for multiple countdown timers running simultaneously,
so you can do a countdown for an overall test and a countup for
individual questions.

On Sep 13, 2:24 am, mdipierro <[email protected]> wrote:
> try this
>
> def page1():
>      form=SQLFORM.factory(Field('test'))
>      if form.accepts(request.vars): pass
>      return dict(form=form)
>
> def page2():
>      return "alert('%')" % repr(request.vars).replace('\'','"')
>
> and a views/default/page1.html
>
> {{extend 'layout.html'}}
> {{=form}}
> <script>
> $(document).ready(function(){
>    $('#no_table_test').keyup(function(){ajax('{{=URL
> (r=request,f='page2')}}',['no_table_test'],':eval');});});
>
> </script>
>
> everytime you press something in the INPUT field with
> id=='no_table_test' generate by the form, it calls page2 on the server
> and passes what is in the server in request.vars. page2 sends back an
> instruction to the client "alert(....)" so that the client can take an
> action decided by the server but triggered by an event on the client.
>
> On Sep 12, 6:16 pm, Ankit Agarwal <[email protected]> wrote:
>
> > I don't have any idea as to how use ajax . Is there any other way I
> > can go about it ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to