Did you know you can change the "specify your own value" text using javascript?
When you create a choice field in a list, that enables users to enter their own choices if the choice they need is not provided; the form will allow the user to choose a existing choice or "specify your own value".
But what if you don't want it to say "Specify your own value" but instead say "Other" or "If not listed, specify in the box below"?
Easy!
A fix is to add a content editor web part to the form page and then enter the following JavaScript:
<script type="text/javascript" src="https://yoursitename/AssetLibrary/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$("input[value='FillInButton']").each(function()
{
var inputID = $(this).attr("id");
$("label[for='" + inputID + "']").html("If not listed, specify in the box below");
}
);
})
</script>
Just be sure to change the highlighted links to match those relevant to your site.
Need help adding a content editor to a form page? Click here.
Wednesday, April 23, 2014
Monday, April 7, 2014
Adding Webparts to New Item, Edit, and Display Forms
If you ever needed to add a web part above a "New Item", "Edit", or "View" form in SharePoint, you will find that it is impossible using the "Site Actions" tab.
A way around this is to add:
&ToolPaneView=2 to the end of the page's URL. This will display the page in Edit mode and allow you to add web parts.
Reference: http://techtrainingnotes.blogspot.com/2013/02/add-content-editor-web-part-cewp-to.html
A way around this is to add:
&ToolPaneView=2 to the end of the page's URL. This will display the page in Edit mode and allow you to add web parts.
Reference: http://techtrainingnotes.blogspot.com/2013/02/add-content-editor-web-part-cewp-to.html
Thursday, October 10, 2013
Remove Recently Modified from Quick Launch
If you are working in SharePoint 2010, you may find that your quick launch creates a section called 'Recently Modified'. This section is great for showing what recently changed on the site. However, it is not always needed.
To remove this section from the quick launch:
To remove this section from the quick launch:
- Add a Content Editor Web Part (CEWP) to the page
- Edit the web part's source code
- Add the following code:
<style> .s4-recentchanges{ display:none; } </style>
The recently modified section will be removed.
Source: http://thechriskent.com/2012/07/05/hiding-the-recently-modified-section-in-sharepoint-2010/
Friday, September 27, 2013
How to Hide the Edit Tab in a Ribbon
In SharePoint 2010, add the following code to a CEWP.
and the tab will disappear :)
Source: http://sharepoint247.wordpress.com/2013/05/24/javascript-to-hide-or-select-specific-tabs-in-sharepoint-ribbon/
<script type="text/javascript">// <![CDATA[function ResetRibbon() {try {var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();SelectRibbonTab("Ribbon.Read", true);ribbon.removeChild('Ribbon.ListForm.Display');ribbon.removeChild('Ribbon.ListForm.Edit');} catch (e){ }}SP.SOD.executeOrDelayUntilScriptLoaded(function () {try{var pm = SP.Ribbon.PageManager.get_instance();pm.add_ribbonInited(function () {ResetRibbon();});var ribbon = null;try {ribbon = pm.get_ribbon();}catch (e) { }if (!ribbon) {if (typeof (_ribbonStartInit) == "function")_ribbonStartInit(_ribbon.initialTabId, false, null);}else {ResetRibbon();}},"sp.ribbon.js");}catch(e){}// ]]></script><script type="text/javascript">function ResetRibbon() {try {var ribbon = SP.Ribbon.PageManager.get_instance().get_ribbon();SelectRibbonTab("Ribbon.Read", true);ribbon.removeChild("Ribbon.ListForm.Display");ribbon.removeChild("Ribbon.ListForm.Edit");} catch (e){ }}SP.SOD.executeOrDelayUntilScriptLoaded(function () {try {var pm = SP.Ribbon.PageManager.get_instance();pm.add_ribbonInited(function () {ResetRibbon();});var ribbon = null;try {ribbon = pm.get_ribbon();}catch (e) { }if (!ribbon) {if (typeof (_ribbonStartInit) == "function")_ribbonStartInit(_ribbon.initialTabId, false, null);}else {ResetRibbon();}} catch (e){ }}, "sp.ribbon.js");</script>Source: http://sharepoint247.wordpress.com/2013/05/24/javascript-to-hide-or-select-specific-tabs-in-sharepoint-ribbon/
Remove Content Approval Message from Forms.
Whenever a SharePoint list requires content approval for submitted items, you will find the following message on your new item forms:
"'Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights.'"
I find this message very confusing to my users so I often remove it.
To remove the message,
- Go to 'List settings' and then 'Advanced settings'
- Scroll down to 'Dialogs'
- Select 'No' under 'Launch forms in a dialog?' then select 'OK'
- Go back to your list and select 'Add new item'. Your new item form will open as a page.
- Go to 'Site Actions ' and select 'Edit Page'
- Add a CEWP (Content Editor Web Part)
- Edit the web part's html source code
- Enter the following CSS:
<style>
.ms-informationbar{visibility:hidden;}</style>
10. Click save
The message will be removed from the form.
If you want your forms to open as dialogues again, simply follow steps 1-3. However, in step 3 select 'Yes' instead.
Friday, August 30, 2013
Show only the time in your sharepoint column
I hate that SharePoint does not provide a time only column. So, what should one do if they have a form in which their users need to record the time only?
In my example, I had to use a time/date column, called "Departure time" in which users needed to provide the time in which they departed a location. However, I did not need a date.
Problem:
In InfoPath, I could delete the date portion of the form and leave only the time field. However, when I went to the list view I would still see a date with their recorded time proceeding.
To get around this I used the steps below:
Source: http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8035f07-8320-48b5-98d7-f48dde2eaf2f/sharepoint-2010-insert-only-time-in-list-column
In my example, I had to use a time/date column, called "Departure time" in which users needed to provide the time in which they departed a location. However, I did not need a date.
Problem:
In InfoPath, I could delete the date portion of the form and leave only the time field. However, when I went to the list view I would still see a date with their recorded time proceeding.
To get around this I used the steps below:
- Created a calculated column called 'Recorded Departure Time'
- Inserted the following formula: =Text (Departure Time,"HH:MM:SS")
- Edited my view to only show only my 'Recorded Departure Time' and hide my original 'Departure time'
Source: http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8035f07-8320-48b5-98d7-f48dde2eaf2f/sharepoint-2010-insert-only-time-in-list-column
Change Link - "Add new item"
At the bottom of your sharepoint list, there is usually a link that say's "Add new item". This link bascially allows users to create new items in a list. However, what if you wanted it to say something different? In my case, I had a contact list and wanted it to say "Add new contact".
Using the steps below, I was able to sucessfully do so.
Source: http://dishasharepointworld.blogspot.com/2011/08/sharepoint-2010-change-add-new-item-and.html
Using the steps below, I was able to sucessfully do so.
- Add a Content Editor webpart to the view you would like the link changed on. Please note: if you have more then one view for this list, you will need to repat these steps for each view.
- Add the javascript below, replacing "your message here" with the message prefer:
<script> document.getElementById("idHomePageNewItem").innerHTML="Your message here"</script>
Source: http://dishasharepointworld.blogspot.com/2011/08/sharepoint-2010-change-add-new-item-and.html
Tuesday, July 2, 2013
Create Calculated Columns Using [Me] or [Today]
As many may know, when creating custom list fields, SharePoint does not allow you to use [Me] or [Today] in a calculated field type.
Here's a workaround, using [Me] as the example. However, you can also use these same steps for [Today] also.
- In your list, create a "single line of text" field titled Me
- Now create a "calculated" field titled CalcMe with the following formula =[Me]
- Now go back and delete the first text field you created titled Me
By doing this you trick SharePoint into using the Me field. Hope this helps :)
Tuesday, June 11, 2013
Adding Javascript to a Quick Launch or Top Link Bar
If you ever tried adding javascript to the Quick Launch or Top Link Bar you'll find it's impossible to do so using the setting page under navigation.
Here's another alternative:
1. Enter one of the following URL's into the address bar (this depends on which of the two you want to edit).
Quick Launch: http://<site address>/_layouts/quiklnch.aspx
Top Link Bar: http://<site address>/_layouts/topnav.aspx
2. Enter your javascript within the web address bar and the link title within the description.
Removing the time from your SharePoint Calendar
Recently, I created a calendar but did not want the out-of-the-box time stamp (12:00) to show by each of my calendar's entries.
Here's what I found to remove this:
BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
}
.ms-acal-time {
DISPLAY: none
}
.ms-acal-sdiv {
MARGIN-LEFT: -58px
}
.ms-acal-sdiv A {
POSITION: absolute; WIDTH: 100%; LEFT: 0px
}
.ms-acal-title {
HEIGHT: 35px; PADDING-TOP: 0px
}
< /style>
Voila! The timestamp is gone.
Source: http://happysharepointing.blogspot.com/2011/10/removing-default-time-from-sharepoint.html
Here's what I found to remove this:
- Add a content editor webpart to your page
- Enter the following code:
<style>
.ms-acal-item {BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-TOP: 0px; BORDER-RIGHT: 0px
}
.ms-acal-time {
DISPLAY: none
}
.ms-acal-sdiv {
MARGIN-LEFT: -58px
}
.ms-acal-sdiv A {
POSITION: absolute; WIDTH: 100%; LEFT: 0px
}
.ms-acal-title {
HEIGHT: 35px; PADDING-TOP: 0px
}
< /style>
Voila! The timestamp is gone.
Source: http://happysharepointing.blogspot.com/2011/10/removing-default-time-from-sharepoint.html
Wednesday, May 8, 2013
Convert a 2007 SharePoint template to 2010
The other day I had to
migrate a few SharePoint 2007 lists to a 2010 site. However, when I tried to do
so, I received a message stating that my templates were not supported. Luckily,
I found a fix.
Hopefully, this can help
others.
- Download the 2007 list template to
a local folder
- Rename the .STP to .CAB
- Open the .CAB
- Extract the .CABs manifest.xml to
a local folder
- Open the xml in Notepad
- Search for ProductVersion. This
it will be 3
- Change it to 4
- Save your change.
- Now Repackage the manifest.xml into
your .CAB
- This can be done by going to your
Start menu and selecting Run
- Enter cmd
- Then entering the
following Syntax: makecab.exe {folder}\manifest.xml
{folder}\{template-name}.cab Example: makecab
H:\myfolder\manifest.xml H:\myfolder\2007template.cab
- If you donot receive a error
message go back into the folder where the .CAB is saved.
- Open the folder and review the
manifest to make sure the Product version 4 has saved within the xml.
- If correct, close the file and
change the cabinet's extension from .CAB back to .STP
- Upload it into your SharePoint
2010 list template library.
Now it should work.
SharePoint Export to Excel via a Link
I recently had a client that did not want to use the "out of the box" export to Excel feature in SharePoint. Instead, they desired a link that could be added anywhere on a page, capable of also providing this functionality.
Step 1:
First, I had to find the guid of the list and view that they wanted to export to Excel. To do this, I went to their SharePoint site's specific list and view, selected modify this view, and then copied the url from the "edit view" page.
Step 2:
I pasted the url into Notepad and removed everything except for the list and view guid (highlighted in yellow below). http://Mysharepointsite/examplesubsite/_layouts/ViewEdit.aspx?List=18c5120f%2Db6be%2D4836%2Dbc6c%2D88d3a7e42aa8&View=%7B5C4DB341%2D0AFA%2D460E%2D9FA4%2D0383CC723FF2%7D
<a href="http://yoursiteurl/yoursubsite/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[listguid]View=[viewguid]&CacheControl=1">Export Report to Excel</a>
Please note, I have found that users must have Microsoft Excel 2007 or later for this to work to export. They must also use Internet Explorer or Firefox as their web browser.
My source: http://weblogs.asp.net/wkriebel/archive/2005/08/22/LinkToExportToSpreadsheet.aspx
Step 1:
First, I had to find the guid of the list and view that they wanted to export to Excel. To do this, I went to their SharePoint site's specific list and view, selected modify this view, and then copied the url from the "edit view" page.
Step 2:
I pasted the url into Notepad and removed everything except for the list and view guid (highlighted in yellow below). http://Mysharepointsite/examplesubsite/_layouts/ViewEdit.aspx?List=18c5120f%2Db6be%2D4836%2Dbc6c%2D88d3a7e42aa8&View=%7B5C4DB341%2D0AFA%2D460E%2D9FA4%2D0383CC723FF2%7D
Step 3:
I added a content editor web part (CEWP)on the page they desired their link.
Step 4:
Finally, I edited the content editor's HTML source and entered the following:
<a href="http://Mysharepointsite/examplesubsite/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=18c5120f%2Db6be%2D4836%2Dbc6c%2D88d3a7e42aa8&View=%7B5C4DB341%2D0AFA%2D460E%2D9FA4%2D0383CC723FF2%7D&CacheControl=1">Export Report to Excel</a>
Here is a another example:
Just replace the yellow highlighted areas with your site's information
Just replace the yellow highlighted areas with your site's information
<a href="http://yoursiteurl/yoursubsite/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[listguid]View=[viewguid]&CacheControl=1">Export Report to Excel</a>
Please note, I have found that users must have Microsoft Excel 2007 or later for this to work to export. They must also use Internet Explorer or Firefox as their web browser.
My source: http://weblogs.asp.net/wkriebel/archive/2005/08/22/LinkToExportToSpreadsheet.aspx
Changing a SharePoint list url
I hate to see % signs in a url and to prevent this, I try to create my urls without spacing. Doing so not only provides a clean address but also a quick and easy way for me to remember them.
However, what do I do if I accidently use spaces and end up with a list url containing % signs?
If I have been granted "full control" to the site, I open Sharepoint Designer!
- Once in Designer, open the site that the url belongs to
- Select "All files" located within the left hand of Designer, under "site objects"
- Select the "lists" folder
- Right click the list that I would like to change
- Select "rename"
- Type the new name and press enter
Subscribe to:
Posts (Atom)