Jump to content

Combining jQuery validate and jQuery Real Person


DBookatay
 Share

Recommended Posts

I'm using jQuery validation to make sure all my required fields are filled in, however I was getting a lot of bot spam and want to use something like jQuery Real Person as a captcha system .

How do I combine the 2, so that submit will fail if the captcha field is not correct?

$("#enroll").validate({

   invalidHandler: function(e, validator) {
      var errors = validator.numberOfInvalids();
      if (errors) {
         var message = errors == 1
           ? 'You missed 1 required field.'
           : 'You missed ' + errors + ' required fields';
           $("div.Error span").html(message);
           $("div.Error").show();
      } else {
         $("div.Error").hide();
      }
   },
});

The link, if relevant is here

Link to comment
Share on other sites

How do I combine the 2, so that submit will fail if the captcha field is not correct?

"The entered value is compared on the server with the generated value..."

 

Use AJAX or post processing. Further, I hope you're not relying on JS only for validation.

Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

×
×
  • 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.