3
Contributors
8
Replies
59
Views
3 Years
Discussion Span
Last Post by chrisschristou
0

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

0

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

window.location.href="#login-box"

0

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 =='');
} }
0

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
    $(loginBox).fadeIn(300);

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

    $(loginBox).css({ 
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });

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

    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() {
    $('#mask').remove();  
}); 
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>
        <label class="password">
        <span>Password</span>
        <input id="password" name="password" value="" type="password" placeholder="Password">
        </label>
        <input type="submit" name="submit" class="submit" value="Log in">
        <input type="submit" name="submit" id="submit" value="Submit">
<p>
  <a class="forgot" href="#">Forgot your password?</a>
</p>        
        </fieldset>
  </form>
</div></div>

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

0

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
button.click(function(){login()})
some thing like that
and replace alert with login()

0

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=="")
  {
  window.location.href="document.getElementById('login-box')";
  return false;
  }
}
</script>

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.