Button with click validation

Note

The task interface configuration guide describes the features of the HTML/JS/CSS editor. You can also try creating a button with click validation in Template Builder.

If a task requires a Toloker to click a link (for example, to open a webpage), Toloka can check if the Toloker did it. The link is displayed in the task as a button.

Variations of button use:

  • Checking if the Toloker opened a link. The output data will contain a field with values true (the Toloker opened the link) or false (the Toloker didn't open the link).

  • Preventing the Toloker from completing the task if the link was not opened. Add the "allowed_values":[true] parameter in the output data description.

To add the button with the link to the task interface, use the {{field type="button-clicked" name="output field name>"}} component. Example:

{{field type="button-clicked" name="ads" label="Click me" href="https://toloka.ai" action=true}}

For a complete list of parameters, see the table.

Add a field of Boolean type to the output data description. To prevent the Toloker from sending responses without opening the link, add the "allowed_values":[true] parameter.

{
"ads": {
"type": "boolean",
"required": true,
"allowed_values": [true]
}
}

Parameters

ParameterDescriptionRequiredDefault value
typeField type: button-clicked — button with click validation.yesno
nameAttribute for the output data field. Contains the output field name.yesno
labelButton text. Example: label="Click me".nono
hrefURL that the Toloker must open to complete the task.nono
sizeSize of the field.

Supported values: "S", "M", "L", "XL".
no"L"
action

Button color:

  • action=true — Yellow.

  • action=false — White.

nofalse
Contact support

Last updated: February 15, 2023

Introduction
Getting started
Important tips
Useful recommendations
Working with Toloka
Projects
Pools
Tasks
Results
Project analysis
Toloka settings
Task interface
Template Builder
HTML/CSS/JS editor
Help and support
FAQTroubleshootingSupportGlossary