SharePoint调查倒计时,然后单击下一步 [英] SharePoint Survey Countdown and Click Next

查看:86
本文介绍了SharePoint调查倒计时,然后单击下一步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个OOB SharePoint调查,该调查询问一些问题,如果用户在20秒内未回答,我们希望该调查跳过该问题并前进到下一个问题.我们有一个使用脚本编辑器的脚本...

< h1 style ="text-align:center">
倒数计时:< div id ="countdown"</div
</h1>
< script>
(功能倒数(剩余){
    if(剩余< = 0)
        location.refresh(true);
    document.getElementById('countdown').innerHTML =剩余;
    setTimeout(function(){countdown(remaining-1);},1000);
})(20);
</script> 

,如果我们更改位置.到location.href ="URL"它行得通-尽管它进入了死页,因为我们不知道前进到下一个问题的URL是什么.

我们希望它前进到下一个问题(超过72个问题),就像.clickNextButton自动发生一样.

关于如何进行这项工作的任何想法?

解决方案

如果您为调查问题设置了分支逻辑,并且想自动转到下一个.

您可以尝试在JS代码中重复使用下一步"按钮逻辑.

用下一个按钮ID替换按钮ID.

 WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00 


ctl40


g_3310ff23_04b7_445d_be0b_4403ca3e5054




We have an OOB SharePoint Survey that asks questions and if the user doesn't answer in 20 seconds, we want the survey to skip the question and advance to the next question. We have a script using Script Editor...

<h1 style="text-align:center">
Countdown:<div id="countdown"></div>
</h1>
<script>
(function countdown(remaining) {
    if(remaining <= 0)
        location.refresh(true);
    document.getElementById('countdown').innerHTML = remaining;
    setTimeout(function(){ countdown(remaining - 1); }, 1000);
})(20);
</script>

and if we change the location.refresh(true); to location.href="url" it works - albeit it goes to a dead page because we don't know what the URL would be to advance to the next question.

We want it to advance to the next question (over 72 questions) as if the .clickNextButton happened automatically.

Any ideas on how to make this work?

解决方案

Hi,

If you set Branching Logic for your survey questions and want to go to next automatically.

You could try to reuse the Next button logic in your JS code.

Replace the button id with your Next button id.

WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00


ctl40


g_3310ff23_04b7_445d_be0b_4403ca3e5054


这篇关于SharePoint调查倒计时,然后单击下一步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆