jquery validate plugin + addmethod('math') for a numeric verification

jquery validate plugin + addmethod('math') for a numeric verification

Hi everyone,
i hardly try to use a method i added

here is the code:

  1. //addMethod( name, method, [message] )
  2.     jQuery.validator.addMethod(
  3.     "math",
  4.     function(value, element, params) { return this.optional(element) || value == params[0] + params[1]; },
  5.     jQuery.format("Please enter the correct value for {0} + {1}")
  6.     );
i added this code between $(document).ready(function(){ and     $("#commentform").validate();

in my form i have:

  1. <label for="captcha">Verification: X + Y = ?</label><input type="captcha" name="captcha" id="captcha" class="required"  /><br />
i try to use the new method math in order to display an addition in the label and the result have to be typed in the input, but i fail, please, can someone help me ?

(sorry for my english)