4 Years
Discussion Span
Last Post by chrisschristou

hello friend
can someone help to replace the alert to redirection to this link <a href="#login-box" class="login-window">Login / Sign In</a> please ???


Instead of alert, you want to redirect the user? Did you try..



thank very much fo reply.
yes exactly i want to redirect "#login-box" display my light box div who content login form.
i tried the below and it don't work.

if (errors) window.location.href="#login-box";
} }

and this one

if (errors) window.location.href="#login-box";
    document.MM_returnValue = window.location.href="#login-box";
} }

i tried this only this had diference because is try to refresh the navigator.

if (errors) window.location.href="#login-box";
    document.MM_returnValue = (window =='');
} }

thank you for the reply
here is the jquery code of lighbox save as poouplogin.js

$(document).ready(function() {
$('a.login-window').click(function() {

            //Getting the variable's value from a link 
    var loginBox = $(this).attr('href');

    //Fade in the Popup

    //Set the center alignment padding + border see css style
    var popMargTop = ($(loginBox).height() + 24) / 2; 
    var popMargLeft = ($(loginBox).width() + 24) / 2; 

        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft

    // Add the mask to body
    $('body').append('<div id="mask"></div>');

    return false;

// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function() { 
  $('#mask , .login-popup').fadeOut(300 , function() {
return false;

Here is the HTML form

<div id="pouplogin"><div id="login-box" class="login-popup">
<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
  <form name="loginform"  class="signin" method="POST"action="<?php echo $loginFormAction; ?>">
        <fieldset class="textbox">
        <label class="username">
        <span>User email</span>
        <input id="username" name="username" value="" type="email" autocomplete="on" placeholder="Email">
        <label class="password">
        <input id="password" name="password" value="" type="password" placeholder="Password">
        <input type="submit" name="submit" class="submit" value="Log in">
        <input type="submit" name="submit" id="submit" value="Submit">
  <a class="forgot" href="#">Forgot your password?</a>

the light box is show when to this link: <a href="#login-box" class="login-window">Login / Sign In</a>


instead of alert you'd want to call the same function your login button calls

either you cant trigger the click function for that button
or create a login function using the code from the login button and then just call it
some thing like that
and replace alert with login()


hello friends,
i have update my code i tryed it but i have this in searchbar http://www.locahost.com/page/document.getElementById('login-box')
this is the script

<script type="text/javascript">
function showloginbox()
var client=document.forms["formulaireajout"]["client"].value;
if (client==null || client=="")
  return false;

and here is the html form <form action="<?php echo $editFormAction; ?>" method="POST" name="formulaireajout" class="formulaireajout" id="formulaireajoutid" onSubmit="return showloginbox()">

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.