We have this Fancybox overlay for the login form on an older, legacy site. I didn't build this site, but I'm trying to make sense of it. I added a link to the new "sign up" page where people can register (toward the bottom of the code).
I have checked a number of other threads here on this website that seem like they should relate to this, but I haven't been able to solve my issue by using them yet. Just wanted you all to know that I did at least search before posting.
So far, I've tried:
- Simple anchor link
- Anchor with javascript redirect, location, etc
Nothing seems to work. I always get this error:
The requested content cannot be loaded. Please try again later.
Losing my mind with this. Something so simple (linking to another page) shouldn't be this difficult.
Markup for what calls the modal:
<a style="float:right;<?= preg_match("/MSIE 7/",$_SERVER['HTTP_USER_AGENT']) ? 'width:135px;' : '' ?>position:relative;top:-3px;left:8px;" href="#login" class="button modal"><span class="begin"></span>Client Login<span class="end"></span></a>
Markup for the modal:
<div id="login" class="modal">
<form id="login" method="post" action="http://myposturl/">
<h3>Enter your user name and password to login:</h3>
<fieldset class="fields">
<p><label for="username">Username:</label> <span class="field"><input type="text" id="username" name="username" tabindex="1" class="required" /></span></p>
<p><label for="password">Password:</label> <span class="field"><input type="password" id="password" name="password" tabindex="2" class="required" /></span></p>
<div class="clear"></div>
<p><a class="button" href="#submit" onclick="document.forms['login'].submit();" onkeypress="document.forms['login'].submit();" title="Login"><span class="begin"></span>Login<span class="end"></span></a>
<a href="javascript:;" class="button" onclick="$.fancybox.close();"><span class="begin"></span>Cancel<span class="end"></span></a></p>
</fieldset>
</form>
<p><a href="http://myregistrationurl/">New User? Register here!</a></p>
</div>
Here's the code that actually calls Fancybox:
<script type="text/javascript">
$(document).ready(function() {
$("a[href*=http://]:not('.facebook_link'),a[href*=https://]:not('.facebook_link')").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'height' : '100%',
'width' : 900,
'speedIn' : 300,
'speedOut' : 0,
'overlayColor' : '#000'
});
$('a.modal').fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 300,
'speedOut' : 0,
'overlayColor' : '#000',
'titleShow' : false
});
$('.cycle').cycle({
fx: 'fade',
pause: true
});
});
</script>