<commit_before>$(function(){
  var check_form_validity = function(){
    if ($('form.was-validated').is(':invalid')) {
      $('.actions').addClass('form-errors')
    }else{
      $('.actions').removeClass('form-errors')
    }
  }

  $('form :input').on({change: check_form_validity, keyup: check_form_validity })

  var $form = $('form.needs-validation');
  $form.on('submit', function(event){
    if ($form[0].checkValidity() === false) {
      event.preventDefault(); // prevents form submission
      event.stopPropagation();
    }
    $form.addClass('was-validated');
    check_form_validity();
  });
});
<commit_msg>fixes ie11 form validation errors<commit_after>$(function(){
  var check_form_validity = function(){
    if ($('form.was-validated :input:invalid').length > 0) {
      $('.actions').addClass('form-errors')
    }else{
      $('.actions').removeClass('form-errors')
    }
  }


  var $form = $('form.needs-validation');

  var validate_form_fields = function(event){
    if ($form[0].checkValidity() === false) {
      event.preventDefault(); // prevents form submission
      event.stopPropagation();
    }
    $form.addClass('was-validated');
    check_form_validity();
  }

  $('form :input').on({change: validate_form_fields, keyup: validate_form_fields })
  $form.on('submit', validate_form_fields);
});

{'fraction_non_alphanumeric': 0.19337848006019565, 'fraction_numerical': 0.003762227238525207, 'mean_word_length': 3.925925925925926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4261273', 'n_tokens_mistral': 425, 'n_tokens_neox': 418, 'n_words': 67}