本文介绍了将带有Javascript的自动完成功能添加到Qualtrics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对Qualtrics在线调查管理软件实施自动完成功能.按照Qualtrics上此功能的 网站,我已经在外观"部分的标题中添加了代码的主要功能.

I'm trying to implement an autocomplete feature to Qualtrics online survey management software. As directed in this feature on the Qualtrics website, I've added the main features of the code to the header of it's Look and Feel section.

<br />
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script><script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script><script>

var $j = jQuery.noConflict();
 $j(function() {
var availableTags = [
  "Selection 1",
  "Selection 2",
  "Selection 3"
];
$j( "#tags" ).autocomplete({
  source: availableTags
});
});
</script>

此外,我已将其添加到希望应用自动完成功能的特定问题栏中.

Also, I've added this to the specific question block I want the autocomplete feature to be applied to.

Qualtrics.SurveyEngine.addOnload(function() {
jQuery(function() {
jQuery( "#tags" ).autocomplete({source: availableTags});
});
});

我没有收到任何错误消息,文本输入字段只是不调用标签.

I receive no error messages, the text input field just does not call up the tags.

推荐答案

尝试将"#tags"更改为".InputText". #tags表示Qualtrics中不存在的ID. .InputText是用于文本输入字段的类.

Try changing "#tags" to ".InputText". #tags refers to an id that doesn't exist in Qualtrics. .InputText is a class used on text input fields.

将其放在Qualtrics标头中(如Anthony推荐):

Put this in the Qualtrics header (as Anthony recommended):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script>
var $j = jQuery.noConflict();
</script>

这是您的问题(没有Qualtrics.SurveyEngine.addOnload),因此它仅适用于有您的问题的页面:

And this in your question (with NO Qualtrics.SurveyEngine.addOnload) so it only applies to the page with your question on it:

$j(function() {
    var availableTags = [
        "Selection 1",
        "Selection 2",
        "Selection 3"
    ];
    $j( ".InputText" ).autocomplete({
        source: availableTags
    });
});

这篇关于将带有Javascript的自动完成功能添加到Qualtrics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 06:18