Show button after login


Tags: php,css

Problem :

i have a joomla login component,now i want when user successfully logs in to show a button that is hidden by css with display:none...here is how i tried...

<?php if (true === $app->login($credentials, $options)) {
        // Success

        $app->setUserState('users.login.form.data', array());
        $app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
        ?><script>
        $$('.formBtn').setStyles({
  display:box;
});
        </script>
        <?php



    } else {
        // Login failed !
        $data['remember'] = (int)$options['remember'];
        $app->setUserState('users.login.form.data', $data);
        $app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
    }
}
?>


Solution :

this is how i did it eventually...

<?php $user =& JFactory::getUser();
if($user->id)
{
?>


<script>
window.addEvent('domready', function() {
  $$('.formBtn').setStyle('display', 'block');
});


</script>
<?php
}
else
{
echo "NOT LOGGED!";
}

?>

    CSS Howto..

    Jquery how to change your website background?

    How can I target only visible objects with nth-child?

    JqueryUi Autocomplete shown in wrong place when using input field in div with position:fixed

    How to lessen CSS

    Box-shadow is not showing or z-index

    How to resize all div images to a particular size?

    How to force dropdown boostrap buttons in a nav bar to fill the entire container width?

    How to change tinymce scrollbar color?

    A plugin or tool to show what elements on a page are effecting other elements?

    How to do this kind of Button in CSS?

    How can I make the menu to wrap when I resize my browser?

    How to make a unique line thinner using NVD3

    How To Move A DIV Element A Little Towards The Top

    How to deal with different stylesheets (WYSIWYG Editor and Webpage one) in the same page?

    CSS 2 Sass: How do I change the output format of the generated SCSS?

    How to style a button inside asp dropdown

    How to obtain the CSS font-family of installed fonts? [duplicate]

    how to apply vertical-align: middle at div

    How align div to a form field?

    Menu hover effect - how to reproduce this effect?

    How do you solve this Chrome button border bug?

    How to fix when someone edits css output of an existing sass file

    How can I position this drupal block?

    How to assign custom CSS class to arbitrary arbitrary rows of h:dataTable?

    CSS: how to make a span only as wide as its content

    How to Change the Color of Selected Content

    How to use px and % in the same layout like this

    How to: mob-responsive menu that will always have a height:100% and show all
  • s although the body gets position:fixed when the list is displayed
  • How to achieve this oval layout with CSS

    How to create a zig zag banner with css