How to: Disable the “No end date” option when creating repeating events

When creating a repeating event using the recurrence column in a SharePoint calendar you have the option of not setting an end date.

Normal

If, however, you wish to disable this option for your users you can by using the following jQuery script.

jQuery(document).ready(function($){
  var rb = $(".ms-formrecurrence input[value='endDateRangeType0']");
  if(rb.length > 0){
    if(rb.attr('checked') == 'checked'){
       $(".ms-formrecurrence input[value='endDateRangeType1']").attr('checked', 'checked'); 
    }
    rb.attr('disabled', 'disabled');
    var tr = rb.parent().closest('tr');
    var attributes = tr[0].attributes;
    var i = attributes.length;
    while( i-- ){
      tr.removeAttr(attributes[i].name);
    }
  }
});
jQuery(document).ready(function($){
  var rb = $(".ms-formrecurrence input[value='endDateRangeType0']");
  if(rb.length > 0){
    if(rb.attr('checked') == 'checked'){
       $(".ms-formrecurrence input[value='endDateRangeType1']").attr('checked', 'checked'); 
    }
    rb.attr('disabled', 'disabled');
    var tr = rb.parent().closest('tr');
    var attributes = tr[0].attributes;
    var i = attributes.length;
    while( i-- ){
      tr.removeAttr(attributes[i].name);
    }
  }
});

You can load the script using a Content Editor Web Part on the event form, load the script directly in your master page or you can use our Script Loader to load the script on every page.

Greyed out

I hope you found this guide useful. If you have any problems or any other questions, please send an e-mail to [email protected] or post a comment.