Custom validation (Regex) does not work test method undefined

Custom validation (Regex) does not work test method undefined

Hello,

I created a custom validation like this
  1. <script type="text/javascript">
    141 $(
    142 function () {
    143 $('#uiGSMnrs').focus();
    144
    145 jQuery.validator.addMethod(
    146'regex',
    147function(value, element, regexp) {
    148return this.optional(element) || regexp.test(value);
    149},
    150'Waarde niet geldig'
    151);
    152
    153$('#SMSForm').validate({
    154 rules: {
    155 uiGSMnrs:{
    156 required: true,
    157 minlength: 10,
    158 regex: '^([+]?[0-9]{10,14}[;]?)+$'
    159 },
    160 uiBericht:{
    161 required: true,
    162 maxlength: 160
    163 }
    164 },
    165 messages: {
    166 uiGSMnrs:{
    167 required: 'Verplicht veld',
    168 minlength: 'Minimum 10 charaters vereist',
    169 regex: 'Waarde niet geldig'
    170 },
    171 uiBericht:{
    172 required: 'Verplicht veld',
    173 maxlength: 'Maximum 160 charaters vereist'
    174 }
    175 }
    176});
    177 }
    178);
    179 </script>







































 
      But the result is that the validation is not working at all. :-(

    You can see a screenshot from firebug here

    http://lh3.ggpht.com/_G2Zw9Fyi6WM/TN-9OguZonI/AAAAAAAABOc/2-ggUz1heRs/s1600/Jqueryvalidation.png

    I use jQuery validation plug-in 1.7 with jQuery JavaScript Library v1.4.2

Can anybody tell me what is wrong ?
 
thanks