Jump to content

Archived

This topic is now archived and is closed to further replies.

DarkReaper

Multi-click problem

Recommended Posts

Hello there, i have a problem i need help with ;)

I have a page on it are many links. I need when a user clicks on one of them all of the links should be disabled (or atleast links with the same name/group), so that the information is submitted correctly. Right now if a user clicks 2 times the information gets half way done and some important stuff is losed in the process. Or if there is a way to prevent the multiclicking using php ... enything! HELP! :)

Share this post


Link to post
Share on other sites
This is a JavaScript issue. 

Instead of having your <a href='link1.php'  you'll need to have a JavaScript function determine if a link has already been clicked.

here's the function:
[code]
var linkclicked=false
function checkclick(url){
if (linkclicked)
{
    return void;
}
else
{
    linkchecked=true;
    window.location.href=url;
    return void;
}
[/code]

now your links should look like this:
[code]
<a href="javascript:checkclick(URL_for_this_link)">
[/code]

there are other ways of doing it, and there might be some details that need to be worked out (I'm not sure how the return void will affect the behavior of the links), but that's the basic idea.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.