Disable all day event in Calendar list
- Hi there,
Is there anyway of disabling the All day Event field in a Calendar list. I don't have the option to hide it either.
Risposte
- Parvez, you can use Office Toolbox feature available on Codeplex, which allows site users to get greater control of your New/Edit/Display forms and their fields for show/hide and also field validations
Hope this helps.- Contrassegnato come rispostaXing-Bing Yu - MSFT lunedì 6 luglio 2009 2.40
Tutte le risposte
If you re-create the form in a new ASPX page using a data view web part, you should be able to edit the form XSL in order to remove the checkbox.
- Yes, I would agree with Kyle. You can re-create the New and Edit forms to remove the all day option - that way a user can't create an all day event.
You could use javascript on the page, instead of breaking the page inheritance using SPD, to hide the row. Using SPD, throw this at the bottom, outside of the web part zone
<script language="javascript">
function HideField(title){
for(var i = 0; i < document.all.length; i++)
{
var el = document.all[i];
// find html element with specified title
if(el.title == title)
{
var pars;
pars = el;
for(var j = 0; j < 10; j++)
{
//loop through parents and hide the parent row
if(pars.className == "ms-formbody")
break; //should have the TD object nowpars = pars.parentNode;
}
pars = pars.parentNode; //get the TR object
pars.style.display = "none"; //and hide the row
break;
}
}
}
{HideField("All Day Event");
}</script>
I've written a webpart that also handles this much easier, if you're interested let me know and I'll send it over. Hoping to get it to codeplex soon.
HTH
David Lozzi
Delphi Technology Solutions
Blog | LinkedIn | Twitter- Hi David,
When I tried the javascript, it didn't work on the Display form. I modified the script a little and now it works on all three forms (display, edit, new). Here's what I used:
Kyle,<script type="text/javascript"> function HideField(title){ var header_h3=document.getElementsByTagName("h3") ; for(var i = 0; i <header_h3.length; i++) { var el = header_h3[i]; var foundField ; if(el.className=="ms-standardheader") { for(var j=0; j<el.childNodes.length; j++) { if(el.childNodes[j].innerHTML == title || el.childNodes[j].nodeValue == title) { var elRow = el.parentNode.parentNode ; elRow.style.display = "none"; //and hide the row foundField = true ; break; } } } if(foundField) break ; } } HideField("All Day Event"); HideField("Recurrence") ; HideField("Workspace") ; </script>
I'm also interested to know how to recreate the forms in Sharepoint Designer. I'm new to Sharepoint Designer. Do you know of a specific article on creating these forms with the same look and feel as other pages in the site. - Interesting... this works for me on the display forms... Thanks for the update!
David Lozzi
Delphi Technology Solutions
Blog | LinkedIn | Twitter - I guess a more simpler solution would be to create a custom list with appropriate fields (start date, end date, etc.) and then creating a calendar view. But You don't get the option to connect it to Outlook 2007. And, when creating a custom list, creating calender view won't give the option for "All Event Event", "Workspace". It also won't have the "Recurrance" functionality.
In my case, I don't need to (although I wanted to) connect it to Outlook 2007. I added some extra fields to the Calendar List, which doesn't appear in Outlook. - If it's a one-off administrative function, i.e the list is created and you simply want to hide the All Day Event field, you can download either SharePoint Manager (CodePlex) or WSS List Configurator (CodePlex) and use those to hide the field. You can even specify which forms to show it on or whether or not just to hide it full stop.
- Parvez, you can use Office Toolbox feature available on Codeplex, which allows site users to get greater control of your New/Edit/Display forms and their fields for show/hide and also field validations
Hope this helps.- Contrassegnato come rispostaXing-Bing Yu - MSFT lunedì 6 luglio 2009 2.40

