Jump to content

Reloading Verification Image


bachya

Recommended Posts

Hi all,

I have a form that uses CAPTCHA as a means of verification that the submitter is not spambot, or anything similar.  I have a button next to the place where the user is supposed to input the letters/numbers in the image:

<button onclick="NewVerifyImage();">New image</button>

...and the NewVerifyImage() function looks like this:

<script language="javascript" type="text/javascript">
var nReload = 5;

function NewVerifyImage()
{
    if (nReload <= 2)
        if (nReload <= 0)
        {
            alert("Sorry, too many reloads.");
            return;
        }
        else
            alert("Only " + nReload + " more reloads are allowed");
    nReload--;
    document.vimg.src = "verifyimg.php";

}
// -->
</script>

This calls a script called verifyimg.php, which would generate a new CAPTCHA image and place it in the image called "vimg" - however, when I click this "New Image" button, it's as though I've clicked submit - the form goes to the page I redirect the user to when info has been submitted.

Does anyone have any idea why it seems like this button is not calling the function properly?

Thanks!
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.