Solved

Disable hyperlink to prevent double clicking

Posted on 2011-09-13
3
407 Views
Last Modified: 2012-05-12
I want to disable a hyperlink after the user has clicked once. e;g

<a href="dothis.cfm?arg1=a>Cleck me once</a>

Open in new window


I can assume all users re using IE 6 or later.
0
Comment
Question by:kcjuliff
3 Comments
 
LVL 16

Assisted Solution

by:SSupreme
SSupreme earned 83 total points
ID: 36533223
try both:
<a href="dothis.cfm?arg1=a" onclick="isClicked()" id="submitButton">Cleck me once</a>
<a href="dothis.cfm?arg1=a" id='submitButton'  onclick="document.getElementById('submitButton').style.display = 'none';">Cleck me once</a>
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 84 total points
ID: 36533947
simplest one
<a href="javascript:goToURL( this )">Cleck me once</a>

function goToURL( thisObj )
{
    location.href = "dothis.cfm?arg1=a";
    thisObj.removeAttribute("href");
}



0
 

Assisted Solution

by:DJ-Andrey-sXe
DJ-Andrey-sXe earned 83 total points
ID: 36535134
Solution with error message if already clicked.

<a href="http://google.com" onclick="if (this._clicked) { alert('Already clicked.'); return false; } this._clicked = true;" target="_blank">Click me only once</a>

Open in new window


In this example first click opens google, second and all next will do nothing and display alert.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now