Validate plugin nog working in IE8

Validate plugin nog working in IE8

I have a form using the validation plugin and it's working great in FF and Safari but not in IE8.

Can anyone tell me what's wrong with this code:

  1. jQuery(document).ready(function($) {
  2.    
  3.     // ajax submit form
  4.     var    $form = $("#contact-form");
  5.     var    $sending    = $("#msg-senging");
  6.     var    $success = $("#msg-success");
  7.     var    $errormsg = $("#msg-err");
  8.    
  9.     // validate form
  10.     $form.validate({
  11.         onfocusout: false,
  12.         rules: {
  13.             contact_form_name: {
  14.                 required: true,
  15.                 minlength: 2
  16.             },
  17.             contact_form_email: {
  18.                 required: true,
  19.                 email: true
  20.             },
  21.             contact_form_message: {
  22.                 required: true,
  23.                 minlength: 10
  24.             },
  25.             contact_form_phone: {
  26.                 minlength: 10
  27.             },
  28.             contact_form_location: {
  29.                 minlength: 4
  30.             }
  31.         },
  32.         messages: {
  33.             contact_form_name: {
  34.                 required: "Please enter your name",
  35.                 minlength: "Your name must consist of at least 2 characters"
  36.             },
  37.             contact_form_phone: "Please provide a valid phone number",
  38.             contact_form_location: "Please provide a valid location",
  39.             contact_form_email: "Please enter a valid email address",
  40.             contact_form_message: {
  41.                 required: "Please enter message",
  42.                 minlength: "Your message must consist of at least 10 characters"
  43.             }
  44.         },
  45.         errorElement: "em",
  46.         errorPlacement: function(error, element) {
  47.             error.appendTo( element.parent().find(".error-wrapper").eq(0) );
  48.         },
  49.         submitHandler: function() {
  50.             // if valid > then submit
  51.             $form.ajaxSubmit({
  52.                 // target identifies the element(s) to update with the server response
  53.                 target: success,
  54.                
  55.                 beforeSubmit: function() {
  56.                     $form.hide();
  57.                     $sending.fadeIn('slow').delay(1500);
  58.                 },
  59.                 // success identifies the function to invoke when the server response
  60.                 // has been received; here we apply a fade-in effect to the new content
  61.                 success: function(rtn) {
  62.                     if(rtn=="Success") {
  63.                         $sending.fadeOut('slow', function() {
  64.                             $success.fadeIn('slow');
  65.                         });
  66.                     } else {
  67.                         $sending.fadeOut('slow', function() {
  68.                             $errormsg.fadeIn('slow');
  69.                         });
  70.                     }
  71.                 }
  72.             });
  73.         }
  74.     });
  75.    
  76.     // default value
  77.     $(".contact-form textarea").defaultValue('Please enter your message here...');
  78.    
  79.     // add .focus class to inputs
  80.     $(".contact-form .input").focus(function() {
  81.         $(this).parent().find("span").addClass('input-focus');
  82.         $(this).addClass('input-focus');
  83.     }).blur(function() {
  84.         $(this).removeClass('input-focus');
  85.         $(this).parent().find("span").removeClass('input-focus');
  86.     });
  87.    
  88.     $(".contact-form .textarea").focus(function() {
  89.         $(this).parent().find("span").addClass("textarea-focus");
  90.         $(this).addClass("textarea-focus");
  91.     }).blur(function() {
  92.         $(this).removeClass("textarea-focus");
  93.         $(this).parent().find("span").removeClass("textarea-focus");
  94.     });
  95.    
  96.     // fadein contact form
  97.     $(".contact-form").delay(100).slideDown('slow');
  98. });
Also, when I click on the submit button a couple of times, the form keeps repeating my error message.