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.

Share

, , ,

About... peter.stilgoe

peter.stilgoeThis author published 482 posts in this site.
Sharepoint, InfoPath, K2, Nintex, Business Process Mapping, Business Intelligence, Automation, ECM, Document Management, Document Imaging, Internet Marketing & Online Business Consultant Email / MSN: pstilgoe@hotmail.com LinkedIn: Pete Stilgoe - Sharepoint Consultant









Share

FacebookTwitterEmailWindows LiveTechnoratiDeliciousDiggStumbleponMyspaceLikedin

6 Comments

  • At 2010.11.19 21:13, Dean said:

    I have inserted this into the CEWP in the Source Editor. When you add it to your ‘Survey Page’ I assume you mean the ‘overview.aspx’. I see no change, it simply displays the keyword trigger that I have entered.

    Perhaps I have missed something in your explanation.

    Has anyone else got this to work?

    Thankss

    [Reply]

    • At 2010.11.23 12:56, peter.stilgoe said:
      peter.stilgoe

      Hi,

      You need to add the script on the page that is actually displaying the survey questions…..

      [Reply]

      • At 2010.12.03 13:52, Hashim Ismail said:

        I am not able to edit the Survey page it self, does not give me option to edit that page. I can edit overview.aspx page.

        [Reply]

        • At 2011.04.11 07:50, John Routledge said:

          I’ve added the form to ‘NewForm.aspx’. No effect. All the script seems to do is substitute startitalic & etc. What version of sharepoint was this script written for? Surely if basic formatting like worked we wouldn’t need the script. What am I missing?

          [Reply]

          • At 2011.06.09 15:42, Renee said:

            Hi,

            Thanks for this solution :)
            I have one question though. Why does it only change the first occurence of ‘linebreak’ and not all of them? (I need more newlines in the same question)
            As a workaround, I named each one differently, but that is really not an elegant solution, lol

            [Reply]

            • At 2011.07.21 20:32, Harry said:

              Hi,
              I also appreciate the posting. This was very helpful because we all know that SharePoint surveys look really bad. I am having the same problem as Renee above: the linebreak only changes the first occurance.

              [Reply]

              (Required)
              (Required, will not be published)