使用 MTurk 上的人群模板进行提交验证

Submission Validation with the Crowd Template on MTurk

我有一个 mturk 调查,想在单击提交按钮时验证结果。我发现讨论了一种方法 here。但是,这似乎不起作用。有人知道吗?

我的代码(JS部分):

<script type="text/javascript">
window.onload = function() {document.getElementById('submitButton').setAttribute('onclick', 'return validateForm()'); }

function validateForm() {
    alert("test");
    return false;
}

没有提示,提交成功

使用新的 Crowd HTML Elements,您可以连接到提交事件并像这样进行预验证:

document.querySelector('crowd-form').onsubmit = function(e ) {
    if (!validateForm()) {
        e.preventDefault();
    }
}

谢谢,

亚马逊土耳其机器人