Validation for Van Westendorp Pricing analysis


I am working on programming a Van Westendorp pricing analysis in a survey.  The basis for this question is a set of 4 text/numeric boxes all on the same page.  The question set is as follows:

Q1- At what price would you consider this widget to be too expensive to consider?
Q2- At what price would you consider this widget to be expensive, but still worth considering?
Q3- At what price would you consider this widget to be a good deal or bargain?
Q4- At what price would you consider this widget to be too cheap, you would question its quality?

After the respondent enters an amount for all questions, I would like validation to check the logic of the amounts entered. If the amounts are incorrect, then display an error telling the respondent which of the follow validations failed.  The validations would be as follows:

– Q2 < Q1 = Expensive below too expensive
– Q3 < Q2 = Bargain below expensive
– Q4 < Q3 = Too cheap below bargain

I have worked with support and other resources and have some javascript for this, however, it is somewhat ‘twitchy’ and not reliable enough to launch with it. It there a way with custom scripting to achieve this instead so that it may be more reliable? 

Any help would be greatly appreciated!

IS answered
    IS 2.21K Rep.

    Incrementing the Loop count should be as simple as:

    %%loopid = 27;
    %%loopcount = sgapiGetValue(%%loopid);
    %%loopcount = %%loopcount + 1;
    sgpaiSetValue(%%loopid, %%loopcount);


    Just replace 27 with the id number of the Loop Count hidden value field.

    IS answered

      I continue to work through this and think that I have a basis for the validation to work now possibly.  However, I am not having any luck with the “Loop Count” and getting the proper script syntax for it.  

      I have the hidden value page assigned as the Loop Count and it’s value of 0.  I then have autosubmitted that page so it isn’t displayed.  But I am unsure how to incorporate the Loop Count and Loop Count + 1.

      Can you provide any further thoughts/ideas on this?



      Jeff Sturm359611 answered

        Thank you so much for the help with this.  

        In theory I think I understand where you are heading with this.  However, I am definitely a rookie in the SurveyGizmo custom scripting world.  Is there any resources or samples that you could direct me to to aid in building this?  I have worked a bit through it but am having some troubles filling in the wholes here and there.

        Again, thank you for any additional help you can offer!

        Jeff Sturm359611 answered
          IS 2.21K Rep.

          I would do it this way:

          On a page before your pricing analysis questions add a Hidden Value called Loop Count with a default set to 0.

          On the page with the pricing questions add a Text/Media with an error message and instructions to fix possible validation errors. This should have display logic to only display when the value of Loop Count is greater than 0. 

          Insert an otherwise blank page after your pricing analysis questions. At the top of the page create a custom script that does your validation checks. Have it set Loop Count = Loop Count + 1. If validation passes use sgapiJumpToPage tto go to the following page. If validation fails, use sgapiJumpToPage to jump back to the page with your pricing questions.

          You may want to add a Jump to exit the loop if the Loop Counter gets too high.

          I haven’t tested this specifically, but it should work for your purposes I think.


          IS answered


            Question stats

            • Active
            • Views10401 times
            • Answers4 answers
            • Followers1 follower