?
Solved

Disable hyperlink to prevent double clicking

Posted on 2011-09-13
3
Medium Priority
?
413 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 332 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:
Gurvinder Pal Singh earned 336 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 332 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Find out what you should include to make the best professional email signature for your organization.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

770 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