Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Thu Jun 20, 2013 2:56 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: TextToHTML Webpart to show Calculated Column on newform.aspx
PostPosted: Thu Jan 20, 2011 12:27 pm 
Offline

Joined: Thu Sep 16, 2010 10:05 am
Posts: 84
i would like to display a hardcoded link on an item when a user composes a request.

The user will say 'I agree' to the terms and conditions as desribed in the employee handbook. Then there would be a link to the handbook.

But you can't show calculated columns on newform.aspx

I add the TextToHTML web part on my newform.aspx I put my html in the description of the field but that didn't help.

SO how can I display a calculated column on the newform.aspx (or accomplish the same objective another way) :)

here is what I added to the description of the checkbox field:
Code:
Please certify that you have read and understand the CONFIDENTIALITY AND NON-DISCLOSURE POLICY section in the Associates Handbook. <DIV><A HREF='/hr/Shared%20Documents/Associate%20Handbook.pdf'>Associate Handbook</a><DIV>


Top
 Profile  
 
 Post subject: Re: TextToHTML Webpart to show Calculated Column on newform.aspx
PostPosted: Thu Jan 20, 2011 1:02 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
It should be able to be appended to the DOM structure via Javascript/jQuery hidden in a CEWP.

Or just make it a choice column in the list and include the link to the document in the description. It will show up as a clickable hyperlink and you are capturing that the users have read the item, at least by acknowledging it, they are saying they have.


Top
 Profile  
 
 Post subject: Re: TextToHTML Webpart to show Calculated Column on newform.aspx
PostPosted: Thu Jan 20, 2011 2:56 pm 
Offline

Joined: Thu Sep 16, 2010 10:05 am
Posts: 84
How can I append it in a CEWP? My form already has a CEWP where I'm using spdservices cascading dropdowns.


Top
 Profile  
 
 Post subject: Re: TextToHTML Webpart to show Calculated Column on newform.aspx
PostPosted: Mon Jan 31, 2011 11:33 am 
Offline

Joined: Thu Sep 16, 2010 10:05 am
Posts: 84
So I came across this post
http://patrikluca.blogspot.com/2009/04/add-url-to-description-of-sharepoint.html

And this might suffice.

Here is my HyperlinkHandbook.js:
Code:
function getTagFromIdentifierAndTitle 
(tagName,identifier,title){     
  var len=identifier.length;   
  var tags=document.getElementsByTagName(tagName);
  for(var i=0;i<tags.length;i++){     
    var tempString=tags[i].id;
    if(tags[i].title==title && (identifier=="" ||     
       tempString.indexOf(identifier)==
       tempString.length - len)){     
      return tags[i];
    }     
  }
  return null;     
}

var myLink = document.createElement('a');     
// The contacts list is located in the same site on the same level 
// as the list for which the hyperlink is added to a column in
// the NewForm.aspx page here
myLink.href = "/hr/Shared%20Documents/Associate%20Handbook.pdf";
// Open the hyperlink in a new browser window     
myLink.target = "_blank";   
// Text of the hyperlink
myLink.innerText = "Link to Associate Handbook     ";

var theSelect=
  getTagFromIdentifierAndTitle("input","","Agreement");     
// if theSelect is null, it means that the target list     
// has more than 20 items, and the Lookup is being
//rendered with an input element     
if(theSelect==null)
{     
  var theInput=getTagFromIdentifierAndTitle("input"   
  ,"","Agreement");   
  // Add the previously created hyperlink in front
  //of the SharePoint column     
  theInput.insertAdjacentElement('beforeBegin',myLink);
}     
else   

  theSelect.insertAdjacentElement('beforeBegin',myLink);
}


but nothing is going on

Here is my CEWP code
Code:
<script language="JavaScript" src="/javascript/HyperlinkHandbook.js"></script>
<script src="/javascript/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="/javascript/jquery/jquery.SPServices-0.5.8.js" type="text/javascript"></script>
<script type="text/javascript">
   $(document).ready(function() {
      $().SPServices.SPCascadeDropdowns({
                  relationshipList: "Access Control Types",
                  relationshipListParentColumn: "ACCategory",
                       relationshipListChildColumn: "Title",
                       relationshipListSortColumn: "",
                       parentColumn: "ACCategories",
                       childColumn: "ACType",
                       promptText: "Choose {0}...",
                       completefunc: null,
                       debug: false
                       });
   });
</script>


Last bumped by sullisnyc on Mon Jan 31, 2011 11:33 am.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group