We've got SP2010 foundation, and the other limitation is that we do not have access to SPD or any of the programmatic ways of accomplishing this. I'm looking for information about how to set this up in a validation formula on the survey settings page.

We're using a survey as a checkpoint quiz after a training session, and each question has a three-choice radio button with one correct answer. We are trying to validate the correct answers, and ONLY advance users to the next question when they answer correctly.

For instance:

What is 1+1?             Today is
O  1            -or-      O  Monday
O  2                      O  Tuesday
O  3                      O  Wednesday

Validation Formulae:
=[What is 1+1]="2"       =[Today is]="Monday"

My expected result is that when "2" or "Monday" are selected from the respective lists, validation passes and the survey advances to the next question. If the choice does not validate, a default "please try again" message will prompt the user until the correct selection is made.

However, using this approach, I get an ERROR: List validation failed dialog box no matter which answer I select in a survey question. Is there a way to evaluate the selected value in a formula?

1 Answer 1


I would recommend using jQuery validation to accomplish this... please see the following links:

http://docs.jquery.com/plugins/Validation http://tinyurl.com/cn6objo

Here is a more concrete example:

Add a Content Editor Webpart (Set IsVisible to false) to your page Inside, include jQuery and jQuery.Validate scripts

//Checks for valid form on save
//Pass this function the validator object you create and the value of the save button
function CheckValidation(val,btn)
    $("input[value='" + btn + "']").each(function(){
        var js = $(this).attr("onclick");
        $(this).attr("onclick", "");
            if(!val.form()) { return false; }
            else { eval(" ( function () {" + js + " })();")};

//Pass this function the display name of your field, the value of the correct answer
//and the error message to display
function ToggleValidator(field,answer,msg)
    $("[title='" + field + "']").rules("add", {
        equalTo: answer,
        messages: {
            equalTo: msg

    //Add validation to the form
    var val = $("#aspnetForm").validate({ 
                    errorClass: "ms-formvalidation"

    //Add one for each field
    ToggleValidator("Your Field Name","Answer","Incorrect");

    CheckValidation(val, "Save");

  • Updated to include sample code, sorry about that!
    – Dom Rocco
    Commented Apr 10, 2013 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.