Support Forums
problem with popup login - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36)
+---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43)
+---- Thread: problem with popup login (/showthread.php?tid=20052)



problem with popup login - nandahosting - 06-29-2011

Hi guys i am new to this forum, I have tried other forums but no-one seems to reply to my post. i really need help with this, and would be very grateful who can.

When you go to my site at www.nandahosting.co.uk there is a "customer login" popup at the top right hand corner with a remember me tick box.

How can i get it so if they have logged in previously, to automatically redirect to the front-page(which is what happens when the fill out the form and click login) instead of putting there details in again.

the css for the popup is

Javascript code for the popup to popup.
Code:
function toggle(div_id) {
    var el = document.getElementById(div_id);
    if ( el.style.display == 'none' ) {    el.style.display = 'block';}
    else {el.style.display = 'none';}
}
function blanket_size(popUpDivVar) {
    if (typeof window.innerWidth != 'undefined') {
        viewportheight = window.innerHeight;
    } else {
        viewportheight = document.documentElement.clientHeight;
    }
    if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
        blanket_height = viewportheight;
    } else {
        if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
            blanket_height = document.body.parentNode.clientHeight;
        } else {
            blanket_height = document.body.parentNode.scrollHeight;
        }
    }
    var blanket = document.getElementById('blanket');
    blanket.style.height = blanket_height + 'px';
    var popUpDiv = document.getElementById(popUpDivVar);
    popUpDiv_height=blanket_height/2-150;//150 is half popup's height
    popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
    if (typeof window.innerWidth != 'undefined') {
        viewportwidth = window.innerHeight;
    } else {
        viewportwidth = document.documentElement.clientHeight;
    }
    if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
        window_width = viewportwidth;
    } else {
        if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
            window_width = document.body.parentNode.clientWidth;
        } else {
            window_width = document.body.parentNode.scrollWidth;
        }
    }
    var popUpDiv = document.getElementById(popUpDivVar);
    window_width=window_width/2-150;//150 is half popup's width
    popUpDiv.style.left = window_width + 'px';
}
function popup(windowname) {
    blanket_size(windowname);
    window_pos(windowname);
    toggle('blanket');
    toggle(windowname);        
}



this is the link at the homepage(www.nandahosting.co.uk) the "customer login" link.
Code:
                    <ul id="toplinkslilo">
                            <li>
                                <p><a class="custloginpu" href="#" onclick="popup('popUpDiv')">Customer Login</a></p>
                            </li>
                            <li>
                                <p><a href="<%= url_prefix %>blog">Blog</a></p>
                            </li>
                            <li>
                                <p><a href="<%= url_prefix %>forum">Forum</a></p>
                            </li>
                    </ul>



This is the form within the div id.

Code:
            <div id="blanket" style="display:none;"></div>
            <div id="popUpDiv" style="display:none;">
                <div id="tbright">
                    <a href="#" onclick="popup('popUpDiv')"><img src="<%= url_prefix %>./theme-images/xclose.png" alt="close" style="float: right; width: 30px; height:26px;" class="close"/></a>
                    <h4>Customer Login</h4>
                    <form action='login' method="post">
                        <div id="boxleft">
                            <p><label for="username2">Username:</label><input name='username' type='text' value='' id='username2'/></p>
                            <p><label for="password">Password:</label><input type='password' name='password' value='' id='password'/></p>
                            <p><label for="permanent">Remember me?</label><input type='checkbox' name='permanent' style="margin: 0 0 20px 10px; width: 13px; float: right; height: 13px;" value='1' id='permanent'/></p>
                        </div>
                    
                        <div id="boxright">
                            <input name="" type="submit" class="btn" value="Login" style="position: relative;"/>
                            <p class="link"><b>New Customer? - </b><a href="<%= url_prefix %>register">Create an account</a></p>
                            <p class="link"><a href="<%= url_prefix %>password-reminder">Forgotten your Password?</a></p>
                        </div>
                    
                    </form>
                </div>
            </div>




I have literally been searching on google for the past few days, trying new things and everything. i have honestly really tried my hardest but i can't get around it. would really appreciate if someone could help me.

thankyou so much



RE: problem with popup login - Positive - 06-29-2011

I have never dealed with a popup login, so I am no use here.
Sorry.

Good luck though.

-- Positive--


RE: problem with popup login - nandahosting - 06-29-2011

same here, this is my first time lol. im starting to wish that i never started it. if no-1 is able to help me by tomorrow then im just gunna redirect it to a page instead of a popup.

and ThanksSmile


RE: problem with popup login - Link - 07-04-2011

Wow this one is a tough-one did you get it figured out yet?


RE: problem with popup login - +GFx - 07-04-2011

Shoot me a PM, I will probably be able to help you out VIA MSN. It will be much easier.


RE: problem with popup login - AceInfinity - 07-04-2011

the css for the popup is not the javascript, they aren't even related for one. I don't quite understand though? you mean after logging in, and another link is clicked on the website, the login doesn't "remember" the user?

It's not handling cookies.