{#
/**
 * Multiple Choice Html : item 'other' row
 *
 * @var $sDisable
 * @var $myfname
 * @var $othertext
 * @var $checkedState
 * @var $kpclass
 * @var $sValue
 * @var $oth_checkconditionFunction
 * @var $checkconditionFunction
 * @var $sValueHidden
 * @var $wrapper
 */
#}

<!-- answer_row_other -->
<li id='javatbd{{ myfname }}' class='question-item answer-item checkbox-text-item {{ relevanceClass }}'>
    <div class="row">
        <div class="col-auto d-flex">
            <!-- Checkbox + label -->
            <div class="checkbox-item othertext-label-checkox-container">
                <!-- checkbox -->
                <input
                    class="other-checkbox"
                    type="checkbox"
                    name="{{ myfname }}cbox"
                    id="answer{{ myfname }}cbox"
                    {{ checkedState }}
                    aria-hidden="true"
                />
                <label for="answer{{ myfname }}cbox" class="checkbox-label control-label answertext"
                       id="label-{{ myfname }}-other">{{ processString(othertext) }}</label>
            </div>
        </div>
        <div class="col">
            <div class="text-item other-text-item">
                <input
                    class="form-control input-sm {{ kpclass }}"
                    type="text"
                    name="{{ myfname }}"
                    id="answer{{ myfname }}"
                    value="{{ sValue }}"
                    aria-labelledby="label-{{ myfname }}-other"
                />
            </div>
        </div>

        <!-- hidden input -->
        <input
            type="hidden"
            name="java{{ myfname }}"
            id="java{{ myfname }}"
            value="{{ sValueHidden }}"
        />
    </div>
    <script type='text/javascript'>
        $('#answer{{ myfname }}').on('keyup focusout', function (event) {
            if ($.trim($(this).val()).length > 0) {
                $("#answer{{ myfname }}cbox").prop("checked", true);
            } else {
                $("#answer{{ myfname }}cbox").prop("checked", false);
            }
            $("#java{{ myfname }}").val($(this).val());
            LEMflagMandOther("{{ myfname }}", $('#answer{{ myfname }}cbox').is(":checked"));
            {{ oth_checkconditionFunction }}(this.value, this.name, this.type);
        });

        $('#answer{{ myfname }}cbox').click(function (event) {
            if (($(this)).is(':checked') && $.trim($("#answer{{ myfname }}").val()).length == 0) {
                $("#answer{{ myfname }}").focus();
                LEMflagMandOther("{{ myfname }}", true);
                return false;
            } else {
                $("#answer{{ myfname }}").val('');
                {{ checkconditionFunction }}("", "{{ myfname }}", "text");
                LEMflagMandOther("{{ myfname }}", false);
                return true;
            }
            ;
        });
    </script>
</li> <!-- Form group ; item row -->
<!-- end of answer_row_other -->
