0

How can I make all events "all day" by default and also hide the all-day checkbox? Do I need to edit the new form or use a content editor web part?

0

There is no OOB way yo set All Day Event default value. You need to add scripts to the NewForm.aspx or EditForm.aspx to check the All Day Event and hide it.

Edit the New Form or Edit Form, enter the following script into the page using a Script Editor web part or a Content Editor web part.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("ready");
function ready()
{
  // checks All Day Event
    if (!$('span[title="All Day Event"] > input').attr("checked"))
    {
    $('span[title="All Day Event"] > input').click();
    }
  //hide check-box
  $('tr:has(span[title="All Day Event"])').not('tr:has(tr)').hide();
  //$('nobr:contains("All Day Event")').closest('tr').hide();
}
</script>

Check the following blog for more information:

https://ootbtutorials.com/2016/03/20/sharepoint-calendar-all-day-option-checked-by-default/

  • Thanks for the info, but it did not work in my enviroment – Ben Segarra Jan 8 at 15:05
  • Could you provide the steps about how you use the script for troubleshooting? Are using the OOB form? Use F12 to check whether the jQuery library and scrips are loaded. – JoannaW_MSFT Jan 9 at 1:27
  • If it helps you, please accept it as the best answer. Thanks – JoannaW_MSFT Jan 10 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.