Sharepoint Survey: Can I add a comment box to a question?

Recently, there was an interesting question in stackoverflow

I am doing a survey in SharePoint, using the built in survey tool.

I want to add a comment box next to my “ratings” questions. e.g.

Q1. Do you like fish?

  1. Not at all
  2. They’re alright
  3. I love fish!

Comment:

How can I do this all within one question? I can obviously add a new text question, but this will become Q2, and I want it to be part of the same question.

Any idea how I can do this?

By default SharePoint does not give us this option. So how can you do this? Here is a work around.

  1. Add a Question, with Text box, below the question under which you need this comment box.
  2. Edit the Newform.aspx page and insert a content editor webpart in the below of existing survey webpart.
  3. Copy and paste the below code in the content editor webpart

[sourcecode language='javascript']

[/sourcecode]

In the above code ctl00_m_g_c7647c31_a9f9_4f27_aa53_e0728c485b2c_ctl00_ctl01_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField is the ID fo the Comment Textbox control. (You can get it by Viewing the Source code of the page).

All we do is get the container of the Textbox control and hide it. Here is the screenshot of a sample survey

About Hojo Clement

Hojo Clement was working in US Technology in Trivandrum as a Senior Software Engineer. He has 6 years experience in working with Web Development Technologies inlcuding MOSS and ASP.net.

8 thoughts on “Sharepoint Survey: Can I add a comment box to a question?

  1. I need to create a survey in sharepoint 2010.for a single question i need more than one answer type.for example i have a question

    q1) who is tall?

    a)raja
    b)gopal
    c)rajkumar

    Now i need to add another text box below this with an description “Others” to enter an Answer other that of those options listed above.

    can u give me the solution.

  2. Apprecizting the commitment youu put into your site and
    detailed information you present. It’s awesome to come across a blog every once in a while that isn’t the same old rehashe
    information. Wonderful read! I’ve bookmarked your site and I’m inclluding your RSS feeds to my Google account.

  3. Its like you read my mind! You appear to know a lot about
    this, like you wrote the book in it or something.

    I think that you could do with some pics to drive the message home a little bit,
    but instead of that, this is great blog. An excellent read.
    I will definitely be back.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>