SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a SharePoint calendar, and I've got some Javascript code to force a calendar overlay event to open in a modal dialog. Basically, it forces them to open in a modal dialog via this code:

$('.ms-acal-ddiv a').click(function(){EditLink2(this,'WPQ2');return false;});

The problem is that there are already "native" events on the calendar which open with this code, and what is happening is that when you click on it, the events open TWICE with a modal dialog, thus rendering the page unusable.

I'm not savvy with writing jquery or javascript. How can I write the javascript to look for that code that's bolded, and prevent it from running if the link already executes with that?

Thanks for the help in advance.

share|improve this question

I wrote a blog post about this issue, you can use JQuery event called event.preventDefault() method to stop the default action of the event and that way you can use your own functionality when the event fires.

Take a look at my post.

Hope it helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.