Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.