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?
- Not at all
- They’re alright
- I love fish!
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.
- Add a Question, with Text box, below the question under which you need this comment box.
- Edit the Newform.aspx page and insert a content editor webpart in the below of existing survey webpart.
- Copy and paste the below code in the content editor webpart
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