Disable double click for HTML links
I’ve got a bunch of users that constantly double click html links. Also, I’ve had a few users probing my apps trying to expose holes. Those probes have generally included either clicking links multiple times, or automatically submitting URLs via some automated process.
When I added messages to guide users that were re-submitting the same URLs, the double click users showed up as potential offenders. I needed a way to keep the double click users off of my intrusion detection report, but still be alerted to the more nefarious users. The solution to this problem is preventing browser based double clicks
I think my solution is elegant. I didn’t find this solution on the Internet, so I decided to post it here.
Simply make the onclick handler for the <a> tag reset it’s onclick handler to return false:
<a href="#" onclick="this.onclick=function () {return false;};return true;">Click Here</a>
I’ve tested this in Chrome/FF/IE8/IE6 and they all seem to work just fine. Comments and feedback welcomed.