Results 1 to 4 of 4

Thread: Enable link after clicking another link

  1. #1
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Enable link after clicking another link

    I'm looking for a script that will enable a link that is unabled at first, but when the user clicks on a specific link, the unabled link is activated.

    Anyone have any good ideas?

  2. #2
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    HTML Code:
    <html>
    <head>
    
    <script language="javascript">
    
    function disableField()
    {
    document.links[0].disabled=false;
    }
    </script>
    </head>
    
    
    <body>
    
    
    <a href="http://www.google.com" disabled=true">LINK 1</a>
    <a href="javascript:disableField() ">LINK 2<a/>
    
    </body>
    </html>

    That should do what you're looking for.

  3. #3
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by keyboard1333 View Post
    HTML Code:
    <html>
    <head>
    
    <script language="javascript">
    
    function disableField()
    {
    document.links[0].disabled=false;
    }
    </script>
    </head>
    
    
    <body>
    
    
    <a href="http://www.google.com" disabled=true">LINK 1</a>
    <a href="javascript:disableField() ">LINK 2<a/>
    
    </body>
    </html>

    That should do what you're looking for.
    Thanks, but that didn't work.
    The link to google is active immediately and there's another problem: If I want the activation link to actually point to another page, how do I do that?

  4. #4
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    If you wanted to have it point to another page you would use the onclick function

    HTML Code:
    <html>
    <head>
    
    <script language="javascript">
    
    function disableField()
    {
    document.links[0].disabled=false;
    }
    </script>
    </head>
    
    
    <body>
    
    
    <a href="http://www.google.com" disabled=true">LINK 1</a>
    <a href="http://www.google.com" TARGET="_blank" OnClick="disableField();">LINK 2</a>
    
    </body>
    </html>
    I don't know why it isn't working. It works fine when I run it. Have you got javascript turned on in your browser?
    Last edited by keyboard; 08-08-2011 at 06:14 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •