Javascript to click a link
Posted: Thu Nov 18, 2010 3:35 pm
My subject is much simpler than my problem and I wasn't sure if I should post this in the PHP board or here. Here are the basics:
I have a site built within Joomla. The standard login is able to be triggered by a link and displayed in a lightbox but as far as I can tell, the lightbox trigger only works when clicking the link. I'm trying to find a way to simulate the clicking of this link but I need to do it only after determining if the user is logged in which is done by calling a Joomla user function. So in a nutshell, here is an example of the code:
This is the code that activates the login lightbox from a link:
Does anyone have any suggestions on how this could be done?
I have a site built within Joomla. The standard login is able to be triggered by a link and displayed in a lightbox but as far as I can tell, the lightbox trigger only works when clicking the link. I'm trying to find a way to simulate the clicking of this link but I need to do it only after determining if the user is logged in which is done by calling a Joomla user function. So in a nutshell, here is an example of the code:
Code: Select all
if ($user->guest) {
EXECUTE SOMETHING HERE TO "CLICK" A LINK TO ACTIVATE THE LIGHTBOX LOGIN
}
Code: Select all
<?php JHTML::_('behavior.modal'); ?>
<a class="modal" href="index.php?option=com_user&view=login&tmpl=component">login</a>