Amazon Mechanical Turk externalSubmit error - html

I am trying to implement an external question in Amazon Mechanical Turk. Everything is working fine except for the submit input which keeps returning the following error:
There was a problem submitting your results for this HIT.
This HIT is still assigned to you. To try this HIT again, click "HITs Assigned To You" in the navigation bar, then click "Continue work on this HIT" for the HIT. If this problem persists, you can contact the Requester for this HIT using the "Contact" link above.
To return this HIT and continue working on other HITs, click the "Return HIT" button.
I have tried everything I can to make the submit task button work and have checked every post I could find on Google and on this website but nothing works.
This is the code for the submit button on my website:
<form name="hitForm" id="hitForm" action="https://workersandbox.mturk.com/mturk/externalSubmit" method="POST">
<input type="hidden" name="assignmentId" value="<?php echo $_REQUEST["assignmentId"]; ?>" />
<input type="hidden" name="hitId" value="<?php echo $_REQUEST["hitId"]; ?>" />
<input type="hidden" name="workerId" value="<?php echo $_REQUEST["workerId"]; ?>" />
<input type="submit" class="btn btn-primary btn-lg active" role="button">
</form>
The user needs to click the submit button on the form once they are done with the task to submit the HIT and receive their payment. I have tried sending the form with more and with less information, I have tried hard coding the information (of the user currently testing the HIT) to the form, I have tried using a hyperlink with the user data, and I have tried submitting the task from different users, from different computers, from different networks, and so on.
Any assistance on this error will be greatly appreciated.
Edit:
I have tried what Thomas has said but I still get the same error message. My form now looks like this:
<form name="hitForm" id="hitForm" action="https://workersandbox.mturk.com/mturk/externalSubmit" method="POST">
<input type="hidden" name="assignmentId" value="<?php echo $_COOKIE["PlayerUserName"]; ?>" />
<input type="hidden" name="foo" value="" />
<input type="submit" class="btn btn-primary btn-lg active" role="button">
</form>
And yes, I am working on the requester sandbox to make sure my entire HIT works properly before opening it to the regular Mechanical Turk.

A couple of possibilities:
Are you using this on the live site? The external submit URL you're using is only for the sandbox. You have to replace workersandbox with www for the live server.
You should not pass hitId or workerId back to the submit URL. These are ignored by MTurk, so there's no point in trying to send them.
You need to send one additional input field besides assignmentId, otherwise the submission will fail. A hidden "foo" field, for example, would be sufficient.

Related

On click of search button send user to new tab showing results from another site?

I am trying to create a search box on my site. However when someone clicks "search" or presses "enter/return". I want a separate tab to open with the search results from a different site to be displayed.
Example:
My site: www.example.com
# using another answer on stackoverflow
# I have tried a lot of different action urls.
# the website url to which I want to send the search:
<form method="get" action="website.com/?searchTerm">
<input type="text" name="searchTerm"/>
</form>
When I try to demo it using the above and press enter, I simply go to the website i.e. website.com/?searchTerm not the results page.
Another approach I thought might work is to replace the searchTerm in the url of the results page of the website when Enter or button is clicked on www.example.com using a tags.
You can use the target attribute on the form tag.
Don’t forget to inform your users, including screen reader users, that the action will open a new tab.
If you use the GET method, input names and values are going to be passed as query parameters. So <input name="searchTerm" value="test"> will become ?searchTerm=test in the requested URL.
get: The GET method; form data appended to the action URL with a ? separator. Use this method when the form has no side-effects.
<form method="get" target="_blank" action="https://example.com/SearchDisplay">
<label>Search Term
<input type="search" name="searchTerm">
</label>
<button type="submit">Search (opens in new tab)</button>
</form>
The above code would not work in an interactive stack snippet, because it would be inside an iframe.
For your search to actually work with the target site
If you inspect the search form on your target website, you’ll notice they use SearchDisplay as the action. Additionally, they include a bunch of hidden fields in their form. You will need to figure out which ones to include in your form as well, for your query to not get blocked.
Beware, though, that this are implementation details of the target shop, not a stable search API like OpenSearch. So it might change at any time, and your search form will no longer work.
The form code from the target website:
<form accept-charset="UTF-8" name="CatalogSearchForm" action="SearchDisplay" method="get" id="searchForm" class="searchForm">
<div class="search-input-wrapper" role="group" aria-label="...">
<div class="search-input-field">
<input type="hidden" name="storeId" value="5451206" id="WC_CachedHeaderDisplay_FormInput_storeId_In_CatalogSearchForm_1">
<input type="hidden" name="catalogId" value="10002" id="WC_CachedHeaderDisplay_FormInput_catalogId_In_CatalogSearchForm_1">
<input type="hidden" name="langId" value="-3" id="WC_CachedHeaderDisplay_FormInput_langId_In_CatalogSearchForm_1">
<input type="hidden" name="pageSize" value="10" id="WC_CachedHeaderDisplay_FormInput_pageSize_In_CatalogSearchForm_1">
<input type="hidden" name="beginIndex" value="0" id="WC_CachedHeaderDisplay_FormInput_beginIndex_In_CatalogSearchForm_1">
<input type="hidden" name="sType" value="SimpleSearch" id="WC_CachedHeaderDisplay_FormInput_sType_In_CatalogSearchForm_1">
…

Occasional Failure of a HTML Form

I have what I think is a pretty simple form for filling in a couple of dates and sending the user to another page. Unfortunately I find that occasionally the data is not passed to the new page, although the user does get to the page.
The code of my form is
<form action="/book/book1.php" method="post" target="_blank" id="bookboxform" name="bookboxform">
<input name="hid" type="hidden" value="<?php echo $hid ?>">
<!-- This next line added to provide an alternative identification of the hotel -->
<input name="hotelname" type="hidden" value="<?php echo $row_hotel['hotel'] ?>">
<input type="text" name="ArrivalDate" id="ArrivalDate" value="" placeholder="Loading.... please wait" readonly>
<input type="text" name="DepartureDate" id="DepartureDate" value="" placeholder="Loading.... please wait" readonly>
<input type="submit" class="button" value="Click Here!">
</form>
The two date inputs use Jquery UI to provide a selectable calendar.
In the second page (book1.php) I use
if(empty($hid) {
to send me an email of the form has failed. This tells me the user-agent.
Generally it seems to be iPhones and iPads that are usually failing, though most others have done it at some time. I estimate it's happening in 2-5% of occasions when someone tries to use the form. What could be causing this random failure?
It would appear that the failures were caused by users copying the url of book1.php and then pasting it into a fresh browser tab. As the data was being passed by POST method, the data was lost. I am now using GET method so the data is a part of the url, and there have been no failures since.

data calling from one page to another?

Hey guys i have a question. I am trying to set up something for my insurance website. I want to setup a capture page where the user inputs everything related to their vehicle and their information and once they click submit and proceed it directs them to another page of mine where it autopopulates all this information and gives them a quote. My question is how could i go about doing this?
The most simple solution is to use a Form on one page, that'll be submitted to another page, where the data will be processed and populated.
you can find many examples on the internet.
here's a good example from PHP's DOCS - Dealing With Forms:
HTML form:
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>
</form>
and action.php file, where the data will be handled:
Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old.
you can see that any information sent with a form via the POST method, can be captured in the target php file using the the $_POST variable (a SuperGlobal).

How can I have a page automatically click a form button after opening local html file

My site has a page where I can parse specific logs by filling out form fields and pressing a submit button.Sometimes I have to parse 100 different logs(which are automatically downloaded by my site from another FTP location) so I'm trying to make it as automated as possible. I have created a file on my local PC named log.html with this content
<form action="MYSITEURL" method="POST" target="_blank" >
<input type="password" name="password" value="MYPASSWORD"/>
<input type="text" name="LogCommand" value="NAME-OF-THE-LOG-AND-LOCATION"/>
<input type="submit" value="Submit1stLog" />
</form>
When I open the log.html file on my local PC, it opens with Firefox and I can see 2 fields which are automatically filled with password and some other info that I need about the log file names and commands, and I have a Submit button. When I manually press Submit, the local file connects to my website and sends those values and submits it.Basically I fill out the form locally instead of going to my website. This way I can have 100 lines like the above one within one local HTML file and press 100 submit buttons manually, instead of going to my site 100 times.
My goal is to have some sort of JavaScript or something similar that will automatically click the Submit button for me as soon as I open the log.html local file.Is this possible? What if I have 100 Submit buttons?
I tried to put the following in log.html but it didn't work
<form action="MYSITEURL" method="POST" target="_blank" > <input type="password" name="password" value="MYPASSWORD"/> <input type="text" name="LogCommand" value="NAME-OF-THE-LOG-AND-LOCATION"/> <input type="submit" id="Submit1stLog" value="Submit1" /> </form>
<script>
function clickButton()
{
document.getElementById('Submit1stLog').click();
}
</script>
If you noticed,I added the id="Submit1stLog" part and then tried to get element ID. This didn't work and I'm terrible at this if you noticed so any help is appreciated !
Thank you.
Try to submit on page load :
window.onload = function(){
document.forms['FORM_NAME'].submit()
}
or you can also click button on page load , but submiting form might be better idea
Here is the Code :
<form name="SITEURL" action="MYSITEURL" method="post" target="_blank" >
<input type="password" name="password" value="MYPASSWORD"/>
<input type="text" name="LogCommand" value="NAME-OF-THE-LOG-AND-LOCATION"/>
<input type="submit" id="Submit1stLog" value="Submit1" />
</form>
<script>
window.onload = function(){
document.forms('SITEURL').submit();
}
</script>
free traffic exchange website
Check Out Post

Submitting to a remote .cfm file using an html form

I want visitors to my website to be able to search for airport lounges offered by a company called Priority Pass. I have created the following form:
<form action="http://prioritypass.com/lounges/lounge-print.cfm" method="post">
<input type="text" id="print_airport_code" name="print_airport_code" value="MAN" />
<input type="submit" value="Submit" />
</form>
Which mirrors the form they have on their own mobile search site (here). But when I submit my form it doesnt seem like the parameters are being posted properly.
Any help would be great. Thanks.
The form on their website doesnt appear to contain any fields which I have missed?
You're pointing to the wrong URL; POSTing to /lounges/lounge-print.cfm is producing an HTTP redirect header, which is corrupting your output.
Additionally, the name of your input field is incorrect. Using someone else's form results often requires you to maintain all field names consistently as they appear on the remote site.
Change the form to:
<form action="http://www.prioritypass.com/mobile/lounges.cfm" method="post">
<input id="Airport_Code" name="Airport_Code" type="text" size="10" value="MAN" />
<input type="submit" value="Submit" />
</form>