Works ok for me on Mac Safari, Chrome and Firefox. Make sure to first create 
at least one room with a status *other* than "verified". You won't see 
anything happen if the status is already "verified".

This one may show it more clearly. It will toggle the status between 
"booked" and "verified".

=== default.py ===
def update_status():
    room = db(db.room.id==request.vars.id).select().first()
    if room.status=='verified':
        room.update_record(status='booked')
    else:
        room.update_record(status='verified')
    return room.status

=== index.html ===
{{extend 'layout.html'}}
<form><input type="hidden" id="id" name="id" value="" /></form>
<ul>
{{for room in rooms:}}
    <li>{{=room.name}} <a href='#' 
onclick="jQuery('#id').val('{{=room.id}}'); ajax('update_status', ['id'], 
'room{{=room.id}}');">[toggle]</a> <span 
id="room{{=room.id}}">{{=room.status}}</span></li>
{{pass}}
</ul>

<<attachment: Screen shot 2011-04-13 at 4.02.19 PM.png>>

Reply via email to