4

Is there any way to make fields required in an Amazon Mechanical Turk HIT? I get some blank responses to the textboxes or radiobuttons in my HTML form and the Amazon's documentation doesn't seem to provide any mechanism for validation.

msha
  • 163
  • 3
  • 10

4 Answers4

2

The easiest way would probably be to use Amazon's API call 'createHIT' to create your HIT: http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/index.html?ApiReference_CreateHITOperation.html

Then, you can specify your HIT questions using a 'questionForm' data structure, which allows defining any field as 'required', and enforces it when the form is submitted.

etov
  • 2,972
  • 2
  • 22
  • 36
  • Thanks. I have used the API before and I think I'm limited when I used the questionsForm and my HTML form is more complex. I was hoping that there is some kind of validation mechanism when the users are submitting the HIT. – msha Nov 24 '10 at 16:33
  • yep, I've actually bumped into your question while looking a solution for the same issue :) – etov Nov 30 '10 at 15:05
2

I think adding the required attribute to your element works fine.

<input class="form-control" id="url" name="url" placeholder="Enter URL here" required="" type="url" />
Rajashree Gr
  • 519
  • 1
  • 9
  • 18
1

I would suggest you create your HIT on an external server, used javascript for form validation and then display the questionnaire on Mechanical Turk using an iFrame.

0

If you don't mind creating an external web app to host your question form, you can create an external HIT and do your validation there.

DougB
  • 674
  • 7
  • 14