NEWS

Tuesday, August 3, 2010

Limiting the number of responses in survey

Many times we require limiting number of responses from survey. However SharePoint does not provide us with the facility to limit the number of responses.




Ok, then how to achieve this? Here we go, follow these simple steps and you are good to go.



(1) Write one web part and write one code which checks for the total responses for specific survey. Add this web part on NewForm.aspx and overview.aspx, all responses and graphical summary of the survey. You get NewForm.aspx when you click on respond to the survey button.



(2) Write down simple code, check URL, if NewForm word exist, then just count the total number of item in survey and if it exceeds let’s say 30 responses, and then redirect back to Source parameter.



(3) If in URL overview, allitems or summary exist, just count the total number of item in survey and if it exceeds let’s say 30 responses then write a statement saying you are not allowed to respond because it has already reached to the maximum responses.

No comments:

Post a Comment