PDA

View Full Version : combine jquery validate and captcha



ViKKKing
05-20-2015, 09:28 AM
Hi folks,

In order to check a form, I'm using jQuery validate v1.13.1.
I also need a captcha and chose the one from tympanus/codrops.

Unfortunately, they won't work together :(

On submit, I need :
- a check on required fields (with validate.js)
- a check with the captcha.

I can't manage to have them both work at once :

Here's the code "validate" :


$("#form-contact").validate({
//e.preventDefault();
rules: {
nom: "required",
email: "required",
tel: "required"
}
});

And the captcha :


$("#formsubmit").click(function(e){
e.preventDefault();
if($('ul').validate1() == true) {
alert("Yeah, you are a human!")
} else {
alert("No, you are not a human!") }
});

Anyone can help please ? any clue ? TY

jscheuer1
05-20-2015, 01:08 PM
Do both on the submit event of the form.

If you want more help. please post a link to the page on your site with the problematic code, so we can check it out.

ViKKKing
05-21-2015, 06:51 AM
Do both on the submit event of the form.
I already tried this but can't have it run properly... I'm more of a PHP user though ^^

The test page : HERE (http://gite-ardennes.info/v2/contact.php)
FYI : this site is for a friend of mine, not a professionnal project :)

Thanks for the help