Solved

Disable hyperlink to prevent double clicking

Posted on 2011-09-13
3
411 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

724 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