{#
/**
 * Multiple Choice Html : item 'other' row
 *
 * @var $sDisplayStyle
 * @var $sDisable
 * @var $sDisplayStyle
 * @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 form-group imageselect-other' {{ sDisplayStyle }} >
        <div class="row row-cols-lg-auto g-1 align-items-center mb-3">
            <!-- Checkbox + label -->
            <div class="checkbox-item othertext-label-checkbox-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="answertext" id="label-{{ myfname }}-other">{{ othertext }}</label>
            </div>

            <!-- comment -->
            <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>


            <!-- 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 -->
