Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74846

Setting HTML Form Fields in Mechanical Turk (MTurk)

$
0
0

Using Mechanical Turk for the first time. Here is a template of what I am trying to do:

<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>

<crowd-form id="form" answer-format="flatten-objects">
  <p id="code"></p>
  <crowd-input name="exit-code" placeholder="paste answer here" required></crowd-input>
</crowd-form>

<script>
// Reference to input .csv form
code_var = ${codes}; 

document.getElementById("code").innerHTML = code_var; 

$("#form").submit( function(eventObj) {
      $("<crowd-input />").attr("type", "hidden")
          .attr("code", code_var)
          .appendTo("#form");
      return true;
  });
</script>

The two things I want that are not happening:

  1. The codes are not being displayed in the <p> tag. If I do <p id="code">${codes}</p> then it does work.
  2. I want to submit both the code from ${codes} and the exit code on form submission. But I cannot figure out how to do that.

Thank you for any hints or advice!


Viewing all articles
Browse latest Browse all 74846

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>