5/16/2009

SharePoint: A better Yes/No field for surveys and lists

 

The out of the box Yes / No column type in SharePoint just displays a checkbox with no text next to it. If you are using it in a survey then you have biased the question as the field is either pre-unchcecked or pre-checked. (and it defaults to YES!)

The workaround? Just use a Choice field with two choices “Yes” and “No”. When used in surveys the end result is exactly the same as Yes/No and it defaults to neither choice selected.

And, you can be more verbose when needed: “Yes I agree” / “No I don’t agree”.

 

Both a normal Yes/No and the Choice Yes/No in a survey (or list) form.

The survey report:

3 comments:

JessinWis said...

Thank you for this suggestion for a better Yes/No field. Exactly the problem I've encountered today. What kind of logical logic uses a single box for yes/no, and, as you state, biases the answer?? Thanks for your help!

Glenn Wallace said...

What if we need a "yes/no" choice, but if they select "no", we need an explanation why. What are the options for "No - Explain"?

Thanks~
glenn.wallace@hughes.com

Mike Smith said...

Glenn,

There are several options:

If you are using SP 2010:
- Add the comments field below the Yes/No and write a validation formula that reports an error if the user selected No and did not enter a comment.

If you are using SP 2010 Enterprise Edition:
- Use the InfoPath button in the list's ribbon and using InfoPath rules make the comment field required if "No" and hidden if "Yes".

If you are using SP 2007:
- Edit the New and Update forms using SharePoint Designer and add some JavaScript to hide/show the comments field and validate that a comment is required if "No". (do a web search for "SharePoint form validation JavaScript")

Mike

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.