Hello

I have a button for user to export some data from db. If he does not have 
the right privileges (that is checked on server) I would like to return an 
alert (possible modal or smth) without redirection after he clicks ok

So far I have an alert but user is redirected to an empty page afterwards


This is my button in html

<div class="btn-group" style="margin-bottom: 20px; margin-top: 10px;">
    <!--      <button onclick="" class="btn btn-primary"><span 
class="glyphicon glyphicon-export"></span>&nbsp;&nbsp;{{ =T('Export EXCEL') 
}}</button> -->
        {{=A(T('iCal export'), _class='btn btn-primary', 
_href=URL('script','iCalDownload',  args = request.args[0]))}}
    </div>

and my controler

def iCalDownoload():
     if user has privilages:
         blah blah blah
     else:
         return SCRIPT("alert('You do not have the right privileges to 
download. Please contact administrator: i...@algit.si')")

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to