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 spend all the morning in searching how to hide/show a DIV by clicking on a link. I'm using SharePoint 3.0 and I have a list of items, and inside the body field (Multiple lines of text - Enhanced rich text) I would like to add some "sub-categories" represented by links. Once you click on the link, it will show the DIV.

My main problem is coming from the fact that Enhanced Text removes automatically href="javascript:switchid('DIV1')" onMouseclick="switchid('DIV1')" that i place inside the tag in "Edit HTML Source".

Update:

Here is what i need to do. Our company has a lot of updates every day. Those updates, kind of documents, needs to be sorted by categories.

I'm storing in a list all the updates that we have. The main text of each update is inside this Enhanced Rich Text field, and because sometimes the update is big i would like to make some kind of summary and when you click on a topic from the summary you have the real content that appears (to show the hidden DIV related to what you clicked from the summary list).

PS. I chose List because of the Preview Pane option.

share|improve this question
    
@Brain: As Anders mentioned, use the comments feature to respond to a particular person. You can also edit your question to add more information (as I have for you). This also bumps your question to the top of the stack. Welcome to SharePoint Overflow :-) –  Alex Angas Sep 1 '10 at 23:18
add comment

2 Answers

I wouldn't use the Enhanced Rich Text field for this, use a Content Editor Web Part to store your javascript or jQuery code.

share|improve this answer
add comment

I did this in one of our previous projects.

You can easily do the same by creating an RTE toolbar extension for a Enhanced Rich text Field. By extending the rich text toolbar you can add a button in there and write a javascript code behind for that button. This JS can then add section which is expandable and collapsable.

here is the link: http://blog.drisgill.com/2007/05/how-to-add-button-to-html-editor.html

share|improve this answer
add comment

Your Answer

 
discard

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