1{# 2 LimeSurvey 3 Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac 4 All rights reserved. 5 License: GNU/GPL License v2 or later, see LICENSE.php 6 LimeSurvey is free software. This version may have been modified pursuant 7 to the GNU General Public License, and as distributed it includes or 8 is derivative of works licensed under the GNU General Public License or 9 other free or open source software licenses. 10 See COPYRIGHT.php for copyright notices and details. 11 12 (¯`·._.·(¯`·._.· Start Form ·._.·´¯)·._.·´¯) 13 14 This file generates the opening form tag and the CRSF token for the main survey Form. 15 eg: 16 <form enctype="multipart/form-data" id="limesurvey" name="limesurvey" autocomplete="off" class="survey-form-container" action="index.php/289445" method="post"> 17 <input type="hidden" value="393e1f3e91d6fb062b8c67d39771bb674de337ca" name="YII_CSRF_TOKEN"> 18 19 It uses the Yii fuction CHtml::form 20 @see: http://www.yiiframework.com/doc/api/1.1/CHtml#form-detail 21 22 The hidden submit button is used for any submission (triggered via JS event). 23#} 24 25{# 26 array of attributes of the form tag. 27 To add a new attribute, just add an entry: 28 'attribute' : 'value', 29#} 30{% set htmlOptions = { 31 'id' : 'limesurvey', 32 'name' : 'limesurvey', 33 'autocomplete': 'off', 34 'class' : 'survey-form-container form', 35 } 36%} 37 38{# If the form contains an upload file question, the enctype of the form must be multipart/form-data #} 39{% if aSurveyInfo.upload_file == true %} 40 {% set htmlOptions = htmlOptions|merge({ 41 'enctype' : 'multipart/form-data', 42 }) 43 %} 44{% endif %} 45 46<!-- Start of the main Form--> 47{{ 48 C.Html.form( 49 ( aSurveyInfo.surveyUrl ), 50 'post', 51 (htmlOptions) 52 ) 53}} 54 55<!-- Ajax value --> 56<!-- Needs to be set by javascript! Because if JavaScript is disabled, ajaxmode will completely fail! --> 57{{ 58 registerScript("AJAXACTIVATE", " 59 $('#limesurvey').append('<input type=\"hidden\" name=\"ajax\" value=\"off\" id=\"ajax\" />'); 60 ", "POS_POSTSCRIPT") 61}} 62 63 64<!-- Field Names --> 65<input type='hidden' name='fieldnames' value='{{ aSurveyInfo.hiddenfieldnames }}' id='fieldnames' /> 66 67{# Hidden inputs needed for logic: thisstep, sid, start_time, LEMpostKey, token #} 68{{ aSurveyInfo.hiddenInputs }} 69 70<!-- Submit button --> 71<button type="submit" id="defaultbtn" value="default" name="move" class="submit hidden" style="display:none">{{gT('default')}}</button> 72