How to modify the Date list form field within Sharepoint Designer 07

I need to modify the default value of the start time and end time of a list form date fields.  As anyone done this?  I also need to modify the minute field drop down to display minute increments instead of 5 minute increments.

Thanks
Abe
LVL 6
Ada CountyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

raybiesCommented:
There is no ootb way to change the time values of the Date field.
You can use javascript to modify the drop down values.

Add a content editor wp to the bottom of the NewForm.aspx or download/edit/upload the page

 ... loop through the page > find the dropdowns > change the values.
0
Ada CountyAuthor Commented:
You wouldn't by chance have an example of this?
0
raybiesCommented:
No, but I just did it... and guess what it didn't work. While I can change the drop down values, SharePoint will display unexpected error when you save if the minute field isn't a multiple of 5.

Here you can test:

1.- Follow this (http://www.sharepointology.com/setup/add-web-parts-to-dispform-editform-or-newformaspx/) to add a Content Edit wp.

2.- Paste the code in to the Source Editor window.

3.- CHANGE my date time field name "MYDT" to  your field name.
<script>
function findMyElement(title){
	var elements = document.getElementsByTagName('input');
	for(i=0; i<elements.length;i++){if(elements[i].title.indexOf(title)>-1){return elements[i];}}
	return false;
}
function findMySelect(obj,i){
	var elements = obj.parentElement.parentElement.children[3].children;
	return elements[i];
}

var dt = findMyElement('MYDT');
var dtHr = findMySelect(dt, 1);
var dtMn = findMySelect(dt, 3);

dtMn.options.length=0;
for (i=0; i<60; i++){
	var o = i;
	if(o<10){o= "0"+ i;}
	dtMn.options[i]=new Option(o, o);
}
</script>

Open in new window

Image1.jpg
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
raybiesCommented:
So your only option is to create a Custom Field.
0
adiga123Commented:
create a feature and when a new entry is made, use object model to insert current DateTime of the  system.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.