<commit_before>$(document).ready(function() {
  var $toggleHandler = $('input[data-toggle]');
  $toggleHandler.on('change', function() {
    var connect = $(this).data('toggle');
    var $target = $('[data-toggle-target]');

    if (connect === 'show') {
      $target.addClass('is-visible');
    } else {
      $target.removeClass('is-visible');
    }
  });
});<commit_msg>add/remove "required" from field (hiding is not enough)<commit_after>$(document).ready(function() {
  var $toggleHandler = $('input[data-toggle]');
  $toggleHandler.on('change', function() {
    var connect = $(this).data('toggle');
    var $target = $('[data-toggle-target]');

    if (connect === 'show') {
      $target.addClass('is-visible');
      $("#birthdate").prop('required',true);
    } else {
      $target.removeClass('is-visible');
      $("#birthdate").prop('required',false);
    }
  });
});
{'fraction_non_alphanumeric': 0.2304199772985244, 'fraction_numerical': 0.0, 'mean_word_length': 3.8729281767955803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7626198', 'n_tokens_mistral': 279, 'n_tokens_neox': 273, 'n_words': 45}