0

On my page i can click the below link and it opens a light box; this contains my login form. what i'm wanting is when i come from another page to this one the form opens without clicking.

<li><a class="cd-signin" href="#0">Sign in</a></li>

So from my splash screen im using

header( "refresh:2;url=Login.php#0" );

Is there anyway i can add class="cd-signin" to the header code?

I know its a stupid question.

1 Answer 1

1

You could always use JavaScript to click the link automatically on page load, if you really wanted it to open the form on page load. (note this is not necessarily the most ideal solution but it will do what you're asking):

<script type="text/javascript">
    window.onload=function(){
        document.getElementById('0').click();
    }
</script>
Sign up to request clarification or add additional context in comments.

3 Comments

Hello, Thanks, the form is only opened with class="cd-signin" and href="#0", ive never used JavScript before; can this class be added into that ?
is it possible ?
Hi @Liam, sorry for the delay. You could in theory use document.getElementsByClassName('cd-signin').click(); but classes are meant to be for multiple elements and in theory it would click every element on the page. You would be better off assigning a unique ID to the element like: class="cd-signin" id="cd-signin" href="#0", then using my original snippet of document.getElementById('cd-signin').click();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.