Posts

Showing posts from April, 2009

Adding Javascript In Amazaon mTurk Form

  Adding JavaScript to mTurk form is possible and very simple. The difference here is that we have been given only body tag of html page. So we have to add JavaScript under body tag of the page. One difficulty that I faced was if there is some error in JavaScript, it simply doesn’t execute the script. So using alert to debug into the JavaScript problem is very useful here. You can get the element in JavaScript using document.getElementById(). But it you want to use syntax document.form.element_name then you should use it like document.mturk_form.element_name. This has worked properly in my case. One more precaution while using JavaScript with mTurk form is that mTurk validates html file with stricter validations. So if your JavaScript is working fine in your html editor but not in mTurk, then there could be syntax problem with your JavaScript which is not supported by mTurk due to stricter validation rules. Technorati Tags: Amazon mTurk , JavaScript