{#
    LimeSurvey
    Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
    All rights reserved.
    License: GNU/GPL License v2 or later, see LICENSE.php
    LimeSurvey is free software. This version may have been modified pursuant
    to the GNU General Public License, and as distributed it includes or
    is derivative of works licensed under the GNU General Public License or
    other free or open source software licenses.
    See COPYRIGHT.php for copyright notices and details.

    (¯`·._.·(¯`·._.· Start Form ·._.·´¯)·._.·´¯)

    This file generates the opening form tag and the CRSF token for the main survey Form.
    eg:
        <form enctype="multipart/form-data" id="limesurvey" name="limesurvey" autocomplete="off" class="survey-form-container" action="index.php/289445" method="post">
        <input type="hidden" value="393e1f3e91d6fb062b8c67d39771bb674de337ca" name="YII_CSRF_TOKEN">

    It uses the Yii fuction CHtml::form
    @see: http://www.yiiframework.com/doc/api/1.1/CHtml#form-detail

    The hidden submit button is used for any submission (triggered via JS event).
#}

{#
    array of attributes of the form tag.
    To add a new attribute, just add an entry:
    'attribute' : 'value',
#}
{% set htmlOptions = {
        'id'          : 'limesurvey',
        'name'        : 'limesurvey',
        'autocomplete': 'off',
        'class'       : 'survey-form-container form',
    }
%}

{# If the form contains an upload file question, the enctype of the form must be multipart/form-data #}
{% if aSurveyInfo.upload_file == true %}
    {% set htmlOptions = htmlOptions|merge({
            'enctype'      : 'multipart/form-data',
        })
    %}
{% endif %}

<!-- Start of the main Form-->
{{
    C.Html.form(
        ( aSurveyInfo.surveyUrl ),
        'post',
        (htmlOptions)
    )
}}

<!-- Ajax value -->
<!-- Needs to be set by javascript! Because if JavaScript is disabled, ajaxmode will completely fail! -->
{{
    registerScript("AJAXACTIVATE", "
    $('#limesurvey').append('<input type=\"hidden\" name=\"ajax\" value=\"off\" id=\"ajax\" />');
    ", "POS_POSTSCRIPT")
}}


<!-- Field Names -->
<input type='hidden' name='fieldnames' value='{{ aSurveyInfo.hiddenfieldnames }}' id='fieldnames' />

{# Hidden inputs needed for logic: thisstep, sid, start_time, LEMpostKey, token #}
{{ aSurveyInfo.hiddenInputs }}

<!-- Submit button -->
<button type="submit" id="defaultbtn" value="default" name="move" class="submit d-none" style="display:none">{{gT('default')}}</button>
