Sharepoint Javascript Error: ‘style.display’ is not null or not an object
By peter.stilgoe
If you are receiving the following error when trying to access the ‘edit’ menu of a webpart on a page:
‘style.display’ is not null or not an object
It is likely that you have some random/extra code in another webpart on the page, this typically happens if you cut & paste text from another location onto the page & it also brings over some formatting chars which upsets Sharepoint. Either:
a) Remove the offending text from another webpart on the page
b) Use something other than IE like Firefox or Google Chrome, typically using another web browser you will be able to edit the troublesome webpart.
One of the better ways of implementing Jquery in your Sharepoint environment
By peter.stilgoe
1. Open up SharePoint Portal and click on Site Actions -> Site Settings -> All Site Settings option
2. Under “Site Administration“group option, Click on “Content and Structure” link
3. From top menu Click “New” List option to create a list of type “Document Library”.
4. Let’s Configure document library further…. Let’s name it as “JavaLib”
[ Note: The name of the document library could be any name you like, I like the name JavaLib as we will use this library to organize all JavaScript’s related resources]
5. (Best Practices) Now, We can configure the JavaLib with additional columns, Versioning and Security so that it can return us a favors like versioning and auto advancing to new versions (if needed).
5.1. Add a column “Script Version” as Single Line of Text to JavaLib
Having “Script version” column becomes very informative when one has lots of developers.
5.2. Configure versioning with 10 Major & 10 Minor Versions
Versioning will allow you to rollback to previous version if there is a bug/known defects without having all other pages needing a modification.
5.3. Set Library security as Read Only to Everyone and Contribute to DevGroup
Limiting who can upload new items (scripts) will help establish controlled processes and release changes using major versions.
6. Let’s download most current JQuery version 1.3.2 from http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js to the desktop
7. Now, Let’s upload jquery.1.3.2.min.js file from our desktop to our JavaLib library.
Note: After uploading the file, Please make sure you change the Name from Jquery-1.3.2.min.js to Jquery and Title as Jquery-1.3.2.min.js and Script version as 1.3.2. This will help us in future if other revisions are available then you do not have to update all webparts with new framework urls.
8. Now we have JQuery available in our environment, with correct control security & versioning in place.
Thanks to Hemendra Patel over @ http://hemsoft.blogspot.com/2009/06/first-look-at-jquery-sharepoint.html
Formatting Text / Questions in Sharepoint Surveys
By peter.stilgoe
If you have ever tried to format text and / or insert line breaks into your questions in sharepoint surveys, you’ll know its not an easy task. However by adding some simple javascript you can format the text in your questions as you want.
Basically at the bottom of your survey page add a Content Editor Webpart & insert the follow script:
You will see the script is mapping your HTML standard HTML command to keywords to trigger your formatting.
So say you wanted your question to appear in italics, you would edit your question as normal but insert the italic keyword triggers ie.
How old are you?
To appear in italics you would write the question as:
startitalic How old are you? enditalic
Now your question will appear in italics and so on……..
If you cant edit your survey page to add you CEWP see the previous post on how to edit this page.



April 14th, 2010
