Tobiwagn1989

0

I have the following problem: We would like to provide a survey where participants are able to register a group for an event. Therefore we use a number field, where users can enter the amount of people they want to enroll. 

We have a limit for each event. This means, if for instance the limit is 100, the number field should only appear as long as less then 100 people are registered. Otherwise, a text box with a message that the event is already full should appear.

I found a method to receive the total amount of respnses (.sgapiResultsQuestionTotal();). How can I use this value to either show or hide a page (that includes the number field) or the question itself, depending on the threshold value for the event limit. 

I already tried with following code:

// HIDE PAGES
sgapiHidePage(3,true);
sgapiHidePage(4,true);

// GET THE VALUE OF THE QUESTION TO CONDITIONALLY SHOW THE PAGE
%%kontingentfull = sgapiGetValue(62);

// ID(62) is the ID of the action that icludes the (.sgapiResultsQuestionTotal() -method. 

// DETERMINE WHICH OPTION IS SELECTED AND SET THE PAGEID ATTRIBUTE TO SHOW THE APPROPRIATE PAGE
if (%%kontingentfull < ’35’){
%%pageid = ‘3’;
} else {
%%pageid = ‘4’;
}

// SHOW THE APPROPRIATE PAGE
sgapiHidePage(%%pageid,false);

 

Thanks in advance. 

Tobi

 

Samuel Anderegg90 asked
    ×

    Login

    Question stats

    • Active
    • Views311 times
    • Answers0 answers
    • Followers1 follower