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..

    How should I make this code to display inline

    jQuery: How to get DIV to slide-off the screen and another to slide in?

    Twitter Bootstrap - how to add some more margin between tooltip popup and element

    Add background to first letter of a row of text. How?

    How to display a div next to another div with no width defined?

    CSS - how to fix the hover?

    How to put a div in more pages

    How to vertically center h1 and span in a li

    How to correctly set background image in a HTML page using a JavaScript function

    How do you close the CSS preview view in Eclipse?

    How to add slide animation when showing elements

    how to make sure image shows over my twitter bootstrap 3 input field

    How to Bring a h1 to top of the div?

    How to inline the contents of an entire stylesheet with Wordpress?

    How insert value from Ruby in CSS file

    How to make background color extend all the way to bottom of page / content?

    How to hide last divider in list of comments using CSS?

    Why are div's not staying in row and how to get them to?

    How Do I Place An Image To The Right of a Body of Text?

    How can I properly display my divs in masonry style using flex?

    How to find resources(CSS , JS Etc) that are blocking in Chrome

    How to make this double line shape with css?

    jQuery select- How to change the css style select?

    How to change CSS when it's ng-disabled?

    Rails 3: How to prevent image caching when the image is specified in the CSS file?

    how to identify if a css class has property in extjs

    How to make pure css floating tooltips (absolutely positioned span) dynamically resize to accommodate text

    Using jQuery toggle to show content, but prevent closing when the user clicks on an input element

    How to get rid of space and align two objects in one line in css/html?

    How to draw a line with button the center of the line