Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SharePoint Calendar NewForm.aspx

  Asked By: Roxana    Date: Aug 09    Category: Sharepoint    Views: 2773

I have a need to remove items from the "Start Time" and "End Time" dropdowns -
remove 3pm & 4pm - that are displayed upon this form. Anyone got an idea of how
this can be done and can point me in the right direction?



4 Answers Found

Answer #1    Answered By: Kamal Mayachari     Answered On: Aug 09

Those dropdowns  are populated programmatically from a sealed class that
Microsoft built. The only way you might be able to remove  individual entries
would be to write a Javascript that would remove them when the page is sent to
the client.

Answer #2    Answered By: Kelsie Terrell     Answered On: Aug 09

Know of any examples of code to do this?

Answer #3    Answered By: Alka Sarabhai     Answered On: Aug 09

Sorry, no I don't. But I did see one in the past that changed the formatting of
individual tabs in the top nav bar, even though they are generated by a single
server control. So it should be possible. I've lost track of that code though
also and Java isn't one of my strong areas.

Answer #4    Answered By: Eashan Nadkarni     Answered On: Aug 09

I whipped up a little something that works in the calendar  NewForm
page. It's fairly static, but can be changed easily and it should do
exactly what you want.

function RemoveTimeSlots() {

// Get all the dropdownlist elements in the page.
var oTime=document.getElementsByTagName("select");
var iT=0;

// Loop through the dropdowns  to find the ones you need to change.
for(iT=0;iT<oTime.length;iT++) {
// Identify all the dropdowns that assign hours).
if(oTime[iT].id.indexOf("DateTimeFieldDateHours")>0) {
This removes the 3PM and 4PM items, but you can easily change that
all parameters to the function to make it more dynamic.

Didn't find what you were looking for? Find more on SharePoint Calendar NewForm.aspx Or get search suggestion and latest updates.