jQuery.validator.addMethod("inf_field_Phone1", function(value, element) { // no phone number is a good phone number (the field is optional) if (value.length == 0) { return true; } // if the phone number field is not empty, it has to follow the fixed format if(!/^33 \(0\)\d \d\d \d\d \d\d \d\d$/i.test(value)) { // ten digits starting with zero if (/^0(\d)(\d\d)(\d\d)(\d\d)(\d\d)$/.test(value)) { value = value.replace(/^0(\d)(\d\d)(\d\d)(\d\d)(\d\d)$/, "33 (0)$1 $2 $3 $4 $5"); $(element).val(value); // also update the form element return true; } } return /^33 \(0\)\d \d\d \d\d \d\d \d\d$/i.test(value); }, 'Please enter your phone number in the following format: 33 (0)1 23 45 67 89'); GetTheGuy Live | Get The Guy