Jump to content

Multi-click problem


DarkReaper

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! :)
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.