Solved

Disable hyperlink to prevent double clicking

Posted on 2011-09-13
3
408 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript Hashmap output 8 44
Show banners that are blocked by Ad Muncher 10 44
Download a website to hdd 2 48
is this a cms? 8 33
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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.
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.

932 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

13 Experts available now in Live!

Get 1:1 Help Now