Solved

Html event for SharePoint 2007 Calendar

Posted on 2012-03-20
6
355 Views
Last Modified: 2012-04-27
Hi

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

Thanks
0
Comment
Question by:shieldguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:svetaye
ID: 37741755
Hello,
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 :
http://www.satya-weblog.com/2010/05/javascript-dynamically-attach-event-handler-html-element.html

In the event handler function you can change selected options in the Finished Time section:
http://www.java2s.com/Code/JavaScript/Form-Control/SelectinganOptionUsingJavaScript.htm

I hope it will help you.
0
 
LVL 1

Author Comment

by:shieldguy
ID: 37741802
Hi,

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.

Thanks
0
 
LVL 11

Expert Comment

by:svetaye
ID: 37741996
I can't find any attachment in your comment.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 1

Author Comment

by:shieldguy
ID: 37742851
Sorry. Please find this now.
calendar.doc
0
 
LVL 11

Accepted Solution

by:
svetaye earned 500 total points
ID: 37743078
Ok,
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:
http://www.codingforums.com/showthread.php?t=178397

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

Author Comment

by:shieldguy
ID: 37746546
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!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question