title: TypeError: 'checkValidity' called on an object that does not implement interface HTMLTextAreaElement
body: <p>I am facing this error and the email could not be sent because of this error. I have added a new extension Birthday reminder in opencart v2.0.1.1
  I have searched about the error but could not resolve it. Please help. code for the file is this.</p>
  
  <pre><code>&lt;form class="form mailForm"&gt;
      &lt;div class="row form-group" style="text-align: center; font-size: 18px;"&gt;
        &lt;div class="col-xs-4"&gt;
            &lt;div class="brCustomerMailInfo"&gt;
                &lt;label&gt;To: &lt;/label&gt;
              &lt;strong&gt;&lt;?php if(!empty($customerInfo['email'])) echo $customerInfo['email']; ?&gt;&lt;/strong&gt;
                &lt;input  type="hidden" name="customer_id" value="&lt;?php if(!empty($customerInfo['customer_id'])) echo $customerInfo['customer_id']; ?&gt;"  /&gt;
                &lt;input  type="hidden" name="to_mail" value="&lt;?php if(!empty($customerInfo['email'])) echo $customerInfo['email'];?&gt;"  /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col-xs-4"&gt;
            &lt;div class="brCustomerMailInfo"&gt;
              &lt;label&gt;Born:&lt;/label&gt;
            &lt;strong&gt;&lt;?php  if(!empty($customerInfo['birthday_date'])){ 
                                echo $customerInfo['birthday_date'];
                            }
                              ?&gt;&lt;/strong&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col-xs-4"&gt;  
            &lt;div class="brCustomerMailInfo"&gt;
              &lt;label&gt;Age:&lt;/label&gt;
              &lt;strong&gt;
                &lt;?php if(!empty($customerInfo['birthday_date'])) {;
                        $now = new DateTime("now"); 
                        if (strpos($customerInfo['birthday_date'],'/') !== false) {
                          echo floor((time()-strtotime(str_replace('/', '-', $customerInfo['birthday_date'])))/(365*60*60*24)) ;
                        } else {
                          echo floor((time()-strtotime($customerInfo['birthday_date']))/(365*60*60*24)) ;
                        }
                      }?&gt;
              &lt;/strong&gt;
            &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
          &lt;div class="col-xs-3"&gt;
              &lt;h5&gt;&lt;strong&gt;&lt;?php echo $discount_code_text ?&gt;&lt;/strong&gt;&lt;/h5&gt;
          &lt;/div&gt;
          &lt;div class="col-xs-9"&gt;
              &lt;strong&gt;&lt;?php echo $discount_code?&gt;&lt;/strong&gt;
              &lt;input type="hidden" class="brSmallField form-control" name="discount_code" value="&lt;?php echo $discount_code?&gt;"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
            &lt;div class="col-xs-3"&gt;&lt;h5&gt;&lt;strong&gt;&lt;span class="required"&gt;* &lt;/span&gt;&lt;?php echo $type_of_discount;?&gt;&lt;/strong&gt;&lt;/h5&gt;&lt;/div&gt;
            &lt;div class="col-xs-3"&gt;
                &lt;select class="form-control" name="discount_type" &gt; 
                    &lt;option value="P"&gt;&lt;?php echo $percentage_text?&gt;&lt;/option&gt;
                    &lt;option value="F" &lt;?php if(!empty($data['BirthdayReminder']['discount_type']) &amp;&amp; $data['BirthdayReminder']['discount_type'] == "F") echo "selected";?&gt;&gt;&lt;?php echo $fixed_amount; ?&gt;&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
          &lt;div class="col-xs-3"&gt;&lt;h5&gt;&lt;strong&gt;&lt;span class="required"&gt;* &lt;/span&gt;&lt;?php echo $discount_text;?&gt;&lt;/strong&gt;&lt;/h5&gt;&lt;/div&gt;
          &lt;div class="col-xs-3"&gt;
              &lt;div class="input-group"&gt;
                  &lt;input type="text" class="brSmallField form-control" name="discount" value="&lt;?php if(!empty($data['BirthdayReminder']['discount'])) echo $data['BirthdayReminder']['discount']; ?&gt;"&gt;
                  &lt;span class="input-group-addon" &gt;%&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
            &lt;div class="col-xs-3"&gt;&lt;h5&gt;&lt;strong&gt;&lt;span class="required"&gt;* &lt;/span&gt;&lt;?php echo $total_amount; ?&gt;&lt;/strong&gt;&lt;/h5&gt;&lt;/div&gt;
            &lt;div class="col-xs-3"&gt;
                &lt;div class="input-group"&gt;
                    &lt;input type="text" class="brSmallField form-control" name="total_amount" value="&lt;?php echo $data['BirthdayReminder']['total_amount'] ?&gt;"&gt;
                    &lt;span class="input-group-addon" &gt;&lt;?php echo $currency ?&gt;&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
          &lt;div class="col-xs-3"&gt;&lt;h5&gt;&lt;strong&gt;&lt;span class="required"&gt;* &lt;/span&gt;Subject:&lt;/strong&gt;&lt;/h5&gt;&lt;/div&gt;
          &lt;div class="col-xs-3"&gt;
              &lt;input placeholder="Mail subject" type="text" id="subject" class="form-control" name="subject" value="&lt;?php if(!empty($data['BirthdayReminder']['subject'])) echo $data['BirthdayReminder']['subject']; else   echo $default_subject; ?&gt;" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
          &lt;div class="col-xs-3"&gt;&lt;h5&gt;&lt;strong&gt;&lt;span class="required"&gt;* &lt;/span&gt;&lt;?php echo $user_email; ?&gt;&lt;/strong&gt;&lt;/h5&gt;&lt;/div&gt;
          &lt;div class="col-xs-9"&gt;
              &lt;textarea class="form-control" id="giftMessage"&gt;
                  &lt;?php if(!empty($customerInfo)) {
                              $wordTemplates = array("{firstname}", "{lastname}", "{discount_code}");
                              $words   = array($customerInfo['firstname'], $customerInfo['lastname'], $discount_code);
  
                              if(!empty($data['BirthdayReminder']['message'][$customerInfo['language_id']])) { 
                                  $message = str_replace($wordTemplates, $words,$data['BirthdayReminder']['message'][$customerInfo['language_id']]);
                                   echo $message;
                              } else {
                                  $default_message = str_replace($wordTemplates, $words, $default_message);
                                   echo $default_message;
                              }
                      }?&gt;
              &lt;/textarea&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row form-group"&gt;
          &lt;div class="col-xs-4"&gt;&amp;nbsp;&lt;/div&gt;
          &lt;div class="col-xs-4" style="text-align: center"&gt;&lt;button class="btn btn-lg btn-primary" id="sendGift"&gt;&lt;?php  echo $send_gift_button; ?&gt;&lt;/button&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;script&gt;
    var gettingOptions = function () {
        $('textarea[id="giftMessage"]').each(function(index, element) {
        $('#'+element.id).summernote({
          height:150
        });
  
        $('.btn#sendGift').on('click', function(e){ 
          e.preventDefault();
          var currentYear  = new Date().getFullYear();
          var errorInput = false;         
  
          if(!$('input[name="subject"]').val()){
            e.preventDefault();
            errorInput = true;
            $('input[name="subject"]').css({'background':'#f2dede'});
           }
  
           if(!validateNumber($('input[name="discount"]'), e)) {
             errorInput = true;
           }
  
           if(!validateNumber($('input[name="total_amount"]'), e)) {
            errorInput = true;
           }
  
          if(!errorInput) {
            var isSentGift = false;
            var lastGift = "&lt;?php if(isset($customerInfo['last_gift_date'])){ $date = explode('-', $customerInfo['last_gift_date']); echo $date[0]; } else { echo '0';}?&gt;";
            if(currentYear == lastGift){
              isSentGift= true;
            } 
  
            sentAgain = true;
  
            if(isSentGift) {
             var last_gift_date = "&lt;?php if(!empty($customerInfo['last_gift_date'])) {
                            echo $customerInfo['last_gift_date']; 
                          } 
                          ?&gt;";
             var sentAgain=confirm("A gift is sent to this customer on " + last_gift_date + ". Do you want to sent this again?");
            }
  
            if(sentAgain){
            $.ajax({
              url:      'index.php?route=&lt;?php echo $modulePath;?&gt;/sendGift&amp;token=' + getURLVar('token') ,
              dataType: 'html',
              data:{  
                discount_code: $("input[name='discount_code']").val(),
                discount: $("input[name='discount']").val(),
                total_amount: $("input[name='total_amount']").val(),
                discount_type: $("select[name='discount_type']").val(),
                customer_id: $("input[name='customer_id']").val(),
                to_mail: $("input[name='to_mail']").val(),
                subject: $("input[name='subject']").val(),
                gift_message: $('#'+element.id).summernote('code') },
                type:     'POST',
                dataType:"json",
                success: function(data){
                $('.messageHasBeenSent').show().delay(3000).fadeOut(600);
                $('.btn.btn-link.active').click();
              }
            });
            }
            $("#sendEmailModal").modal('hide');
          } 
          else { 
          e.preventDefault();
          }
        });                      
      });
    };
  
    $("#sendEmailModal").on('shown.bs.modal', function (e) {
      gettingOptions();  
    });
  
    if($('select[name="discount_type"]').val() == 'P'){
      $('#percentageAddonForm').show();
    } else {
      $('#currencyAddonForm').show();
    }
  
  $('select[name="discount_type"]').on('change', function(e){ 
    if($(this).val() == 'P') {
      $('#percentageAddonForm').show();
      $('#currencyAddonForm').hide();
  
    } else {
      $('#currencyAddonForm').show();
      $('#percentageAddonForm').hide();
    } 
  });
  
    function validateNumber(input, theEvent) { 
      var regex = /[0-9]|\./;
      if(!regex.test(input.val())) {
        input.css({'background':'#f2dede'});
        return false;
      } else {
        return true;
      }
    }
  &lt;/script&gt;
  </code></pre>