Hiding an element or text after login

25 views
Skip to first unread message

mostwanted

unread,
Jun 26, 2019, 2:29:54 PM6/26/19
to web2py-users
I want to hide a span containing text after logging in, i tried this below but it aint working:
CODE:
{{if auth.user:}}
<script>
    $
(document).ready(function(){
    $
('.textContainer').hide();
   
});
   
</script>
    {{pass}}

<span class="
textContainer">PLEASE LOG IN FIRST TO BE ABLE TO GET THE MENU & BUY</span>

 What can i do to achieve my task?

Regards;

Mostwanted

Константин Комков

unread,
Jun 26, 2019, 2:48:59 PM6/26/19
to web...@googlegroups.com
Check that your conditions and pass quantity coincides. Becouse your code correct work in my app. Also you can do like that:
{{if auth.user:}}
<!-- your content -->
{{else:}}
<span class="textContainer">PLEASE LOG IN FIRST TO BE ABLE TO GET THE MENU & BUY</span>
{{pass}}


mostwanted

unread,
Jun 27, 2019, 12:16:09 AM6/27/19
to web2py-users
I dont know if its because i added the {{else:}} statement but its working now, thank you @ Константин Комков
Reply all
Reply to author
Forward
0 new messages