Skip to main content

Impossible to click drop-down answer values in Manual Task

The instruction describes how to fix the issue when you cannot click drop-down answer values with an apostrophe in an information extraction Manual Task.

Symptoms

The steps below describe how the issue occurs:

  1. Create a Select One answer in the legacy Manual Task where the value includes an apostrophe. For details, see Answer Types | Select One.

  2. Add a sub-answer with the expand:on() CSS rule.

  3. Run the task and open its preview.

  4. If you try to select the value with an apostrophe, you cannot do this. In the console, you see the following error:

    jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: :regex(class, expand:on\(value'1\))
    at Function.nt.error (VM1427 jquery.min.js:2)
    at ut (VM1427 jquery.min.js:2)
    at vt (VM1427 jquery.min.js:2)
    at Function.nt [as find] (VM1427 jquery.min.js:2)
    at init.find (VM1427 jquery.min.js:2)
    at HTMLOptionElement.<anonymous> (<anonymous>:255:71)
    at Function.each (VM1427 jquery.min.js:2)
    at init.each (VM1427 jquery.min.js:2)
    at expandCollapseNested (<anonymous>:252:35)
    at HTMLSelectElement.<anonymous> (<anonymous>:265:54)

Cause

You cannot click a drop-down answer value with an apostrophe if it is a parent answer with the expand:on functionality.

Resolution

To resolve the issue, follow the instruction below:

  1. In Control Tower, go to Advanced > Templates.

  2. Find and open the html.ftl file.

  3. Find the function and replace it with the following:

    function escapeRegExp(str) {
    return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|\']/g, "\\$&");
    }

View also: