Html event for SharePoint 2007 Calendar


I have a SharePoint form with the 2 fields 'Start Time' and 'Finish Time'. All I am trying to do is when user a selects a date from 'Start Time' calendar, the same date is copied in the 'Finish Time'. To achieve this I was looking for a calendar event say 'onSelect' or something similar where I can write my code. Is there any event like this or if someone can suggest me any other solution

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

You can use an "onchange" event to the Start Time Hours and Minutes drop down boxes.
You need to find the the element ID on the page and attach your event handler :

In the event handler function you can change selected options in the Finished Time section:

I hope it will help you.
shieldguyAuthor Commented:

Thanks for your reply but it's not the time hours and minutes drop down I was talking about but the actual calendar from where the user selects the DATE. Please find the attached file where I have marked the calendar to make it clear.

I can't find any attachment in your comment.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

shieldguyAuthor Commented:
Sorry. Please find this now.
This is the same "onchange" event like I wrote just on the "Date" textbox. When user choose a date this date shows in relevant textbox.You need to attach the "onchange" event to this textbox and if this textbox value has been changed you fired a function that copy the date to another textbox .

Check this thread:

There is an example with "dropdown" and "textbox" but it have the same logic.

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
shieldguyAuthor Commented:
Just to add some additional information here which I feel will be helpful for you to understand the scenario. As explained I need to copy the 'Start Time' into 'Finish Time'. This needs to be done in case if user enters the date by actually typing using keyboard or by selecting the date from calendar. So far what I had achieved was the first one where I enter the date using keyboard in the 'Start Time' field and as soon as I leave the text box (either by using tab key or by clicking the mouse somewhere where else) it copies the date to the 'Finish Time' text box. This was achieve by the following jQuery function.

 $("input[title='Start Time']").blur(function(event)
                   c$("input[title='Finish Time']").val($("input[title='Start Time']").attr("value"));

However, when I select a date from calendar it doesn't copy. As you said to use 'onchange' I tried the following jQuery function and it didn't work. This event is not fired for anything thing I do.

 $("input[title='Start Time']").onchange(function(event)
                   c$("input[title='Finish Time']").val($("input[title='Start Time']").attr("value"));

Thanks for all your help!
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.