HTML calculated field

rss

Posted by cgrunke - Sep 25 ’13 at 01:36

I was wondering if there was a way to display a HTML calculated field as a clickable link.  I have a sharepoint column that I formatted to create a HTML link based off of another field.  I used the procedure in the following link to accomplish this.http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/.

I then create a Content Editor Web Part and place it below the form.  in the HTML section of the CEWP I place this code: http://www.pathtosharepoint.com/Downloads/TextToHTMLlite-v2.1.1.txt

This all works until I switch from the default sharepoint display form to the Sharepoint Forms Designer.

Any suggestions on getting a HTML calculated column to work in Sharepoint Forms Designer?  The solution wouldn't necessarily have to use the solution I linked to above.  I just wanted to share what I have tried so far.

Thanks in advance.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 10 months 28 days
    #1 by Dmitry Kozlov Sep 26 ’13 at 04:15

    Hello,

    Put your calculated column into the form with Forms Designer. Then put the following code into JS-editor of Forms Designer:

    var text = fd.field('Calc1').control()._el().text();
    fd.field('Calc1').control()._el().html(text);

    In my example the internal name of the calculated column is 'Calc1', so you have to replace it with your internal name.

  • cgrunke
    Member
    Member for: 5 years 10 months 23 days
    #2 by cgrunke Sep 26 ’13 at 10:12

    Perfect!  works exactly how I wanted.  Thanks a lot!

Displaying 1 to 2 of 2 messages