Hi there!
I am hiding a question with the following JavaScript-Code which is on the same page.
$(document).ready(function(){
$(“.p23”).hide();
var consum1 = ‘[question(“value”), id=”69″]’*1;
var consum2 = ‘[question(“value”), id=”73″]’*1;
var consum3 = ‘[question(“value”), id=”74″]’*1;
var consum4 = ‘[question(“value”), id=”75″]’*1;
if (consum2 > consum1 && consum2 > consum3 && consum2 > consum4){
$(“.p23”).show();
}
});
How can I skip or autosubmit this page if the question is hidden?
Is there something like “if hidden than sgapiJumpToPage(%%next_page_id);”?
Best regards,
Christian
Best answer
CustomScript:
sgapiHidePage(23,true);
%%consum1 = sgapiGetValue(69);
%%consum2 = sgapiGetValue(73);
%%consum3 = sgapiGetValue(74);
%%consum4 = sgapiGetValue(75);
if (%%consum2 > %%consum1 && %%consum2 > %%consum3 && %%consum2 > %%consum4)
{
sgapiHidePage(23,false);
}
Question – are there other questions on the page, or just the script and the question (q71)?
If q71 is on its own page, my group would probably place the script on an admin page, and then use the sgapiHidePage function to hide or unhide the page with q71 on it as needed (a hidden page will be skipped and will never be seen by the respondent). We would also use custom scripting for this rather than JavaScript.