[英]How to change default apache login/password pop-up box to custom using js/html/php?
[英]Custom Pop-Up for Unanswered Multiple Choice in Qualtrics Using JS
我试图从本质上创建一个弹出请求响应,以在未回答多项选择题时通知参与者,但允许他们继续(但我想拥有自定义文本)。 这是我一直在玩的东西,但是我无法使其工作(这是针对问题ID 28的问题):
$(document).ready(function() {
// Identify this question
var thisQuestion = $('#question{QID28}');
// Interrupt the Next/Submit click
$('#movenextbtn, #movesubmitbtn').bind('click', function () {
var unanswered = false;
// Loop through all inputs
$('input.text', thisQuestion).each(function(i) {
var thisValue = $(this).val();
if(thisValue == null) {
unanswered = true;
}
});
// Pop up confirm if we found an unanswered item
var cont = true;
if(unanswered == true) {
cont = confirm('You have an unanswered item.\nDo you want to continue?');
}
return cont;
});
});
在标题中,我有以下内容:
<script type="text/javascript" charset="utf-8"> </script>
有人能指出我正确的方向还是告诉我这段代码有什么问题? 我想我没有正确配置它来确保选择了多项选择响应,但是我不知道从这里去哪里。
我认为您正在使用JQuery,但是有一个非常简单的标准javascript答案。 通过这种方式,我会提出一个带有警报的悬而未决的问题,使您可以选择取消还是继续。
<script type="text/javascript">
function checkers() {
if (answer = 0) {
getConfirmation();
}
}
function getConfirmation(){
var areusurebro = confirm("There is an unanswered question would you like to continue?");
if( areusurebro == true ){
continue;
}
else{
break;
}
}
</script>
检查器检查是否没有答案。 getConfirmation是javascript中的确认功能。 (要获得答案,您必须创建另一个将值设置为变量的函数,如答案)
<script>
var answer = 0;
function clicked1() {
answer = 1;
}
function clicked2() {
answer = 2;
}
function clicked3() {
answer = 3;
}
function clicked4() {
answer = 4;
}
</script>
然后在每个答案的多项选择中,输入onclick =“ clicked1”或相应的选择号
这也可能在您的代码中。
<form>
<input type="button" value="Submit" onclick="checkers();" />
</form>
从那里处理答案可能会使用php或其他javascript库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.