diff --git a/dvg_appointments.js b/dvg_appointments.js
index a9bc296..c50841f 100644
--- a/dvg_appointments.js
+++ b/dvg_appointments.js
@@ -1,4 +1,23 @@
 (function ($) {
+  Drupal.behaviors.dvgAppointments = {
+    attach: function (context, settings) {
+      $('.wa-product-product', context).once('dvgAppointments').change(function (e) {
+        $(this).parents('.fieldset-wrapper').find('.messages.error').hide();
+        $(this).parents('.fieldset-wrapper').find('input.error').removeClass('error');
+        // Hide the global form error message only if all other field-specific error messages are gone.
+        var allErrorsHidden = true;
+        $(".error.messages-inline:visible").each(function () {
+          if ($(this).length === 1) {
+            allErrorsHidden = false;
+          }
+        });
+        if (allErrorsHidden) {
+          $(".messages.error").hide();
+        }
+      });
+    }
+  };
+
   // Resets the value of the count-field when a product with max_persons
   // being 1 is selected. The count-field will be hidden by 'states' and
   // 'state:visible'-event will be triggered.
diff --git a/dvg_appointments.module b/dvg_appointments.module
index 7396d27..0fe8786 100644
--- a/dvg_appointments.module
+++ b/dvg_appointments.module
@@ -794,6 +794,7 @@ function dvg_appointments_product_element_process($element, &$form_state, $form)
     '#title' => t('Product'),
     '#required' => TRUE,
     '#options' => $product_options,
+    '#attributes' => array('class' => array('wa-product-product')),
   );
 
   if (!empty($element['#default_value']['product'])) {
@@ -811,6 +812,7 @@ function dvg_appointments_product_element_process($element, &$form_state, $form)
     '#maxlength' => 4,
     '#default_value' => !empty($element['#default_value']['count']) ? $element['#default_value']['count'] : 1,
     '#element_validate' => array('element_validate_integer_positive'),
+    '#attributes' => array('class' => array('wa-product-count')),
   );
 
   if (count($invisible_values) > 1) {
