Jump to content

Combining jQuery validate and jQuery Real Person


DBookatay

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

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.

Archived

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

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