Log in

View Full Version : Enable link after clicking another link



designadinblogg
08-07-2011, 05:12 PM
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?

keyboard
08-08-2011, 04:56 AM
<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.

designadinblogg
08-08-2011, 05:33 AM
<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?

keyboard
08-08-2011, 06:03 AM
If you wanted to have it point to another page you would use the onclick function


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