Showing posts with label SP 2010. Show all posts
Showing posts with label SP 2010. Show all posts

Wednesday, April 23, 2014

Changing the "Specify your own value" text in a new item form

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.

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:

  1. Add a Content Editor Web Part (CEWP) to the page 
  2. Edit the web part's source code 
  3.  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.



<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>

and the tab will disappear :) 

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,

  1. Go to 'List settings' and then 'Advanced settings'
  2. Scroll down to 'Dialogs' 
  3. Select 'No' under 'Launch forms in a dialog?' then select 'OK'
  4. Go back to your list and select 'Add new item'. Your new item form will open as a page.
  5. Go to 'Site Actions ' and select 'Edit Page'
  6. Add a CEWP (Content Editor Web Part)
  7. Edit the web part's html source code 
  8. 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:
  1. Created a calculated column called 'Recorded Departure Time'
  2. Inserted the following formula: =Text (Departure Time,"HH:MM:SS")
  3. Edited my view to only show only my 'Recorded Departure Time' and hide my original 'Departure time'
Please Note: This method will show in military time. However, if you don't mind military time; this is a great solution.

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.

  1. 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.
  2. 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

Wednesday, May 8, 2013

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!

  1. Once in Designer, open the site that the url belongs to 
  2.  Select "All files" located within the left hand of Designer, under "site objects"
  3. Select the  "lists" folder
  4. Right click the list that I would like to change
  5. Select "rename"
  6. Type the new name and press enter