Combine jQuery Form Validation Plugin + basic captcha scheme?

Combine jQuery Form Validation Plugin + basic captcha scheme?

Hello

I'd like to use a simple JavaScript anti-spam scheme and found this one that requires the user to add two numbers.

Problem is, I'm no JavaScript expert and don't know how to have the jQuery plug-in go on validating the form once the user has answered the math question successfully:

  1. <html>

  2. <head>
  3.   <script type="text/javascript">
  4.     var a = Math.ceil(Math.random() * 10);
  5.     var b = Math.ceil(Math.random() * 10);       
  6.     var c = a + b
  7.     function DrawBotBoot()
  8.     {
  9.         document.write("R&eacute;sultat de "+ a + " + " + b +"? ");
  10.         document.write("<input id='BotBootInput' type='text' maxlength='2' size='2'/>");
  11.     }    
  12.     function ValidBotBoot(){
  13.         var d = document.getElementById('BotBootInput').value;
  14.         if (d == c) return true;        
  15.         return false;
  16.     }
  17.   </script>
  18.   
  19.   <script>
  20.   //Used by jQuery to validate all form fields
  21.   $(document).ready(function(){
  22.     $("#myform").validate();
  23.   </script>
  24. </head>

  25. <body>
  26. <form action="send.php" method="post" id="myform">
  27. <input type="text" maxlength="25" id="name" name="name" class="required"/>
  28. Are you human?<br />
  29. <script type="text/javascript">DrawBotBoot()</script>
  30. <input id="Button1" type="button" value="Send" onclick="alert(ValidBotBoot());"/>
  31. </form>
  32. </body>
  33. </html>

Would someone know?

Thank you.