Skip to content

Instantly share code, notes, and snippets.

@flik flik/create.html
Last active Aug 29, 2015

Embed
What would you like to do?
Fwd: error message after upload [Problems #13336]
<form onsubmit="return validateForm();" method="post" enctype="multipart/form-data" name="quizform" id="quizform" class="form-horizontal" novalidate="novalidate">
<div class="row-fluid">
<input type="text" autocomplete="off" placeholder="Untitled Survey" class="editable_title span4 pull-left" value="Zeropoint" id="quiztitle" name="quiz[quiztitle]">
</div>
<br>
<div class="row-fluid">
<div class="span6">
<i id="openurlsettings" data-toggle="modal" data-target="#setUlrParams" class="icon-random pull-left"></i>
<p class="pull-left">URL: http://su.vc/</p>
<input type="text" required="" value="zero" name="quiz[urlname]" class="pull-left" id="nameurl" autocomplete="off">
<i class="icon-ok-sign icon-green urlok"></i>
<i class="icon-remove-sign urlnok"></i>
</div>
</div>
<!-- INTRO SCREEN -->
<div class="row-fluid">
<div class="span12">
<div id="introscreenform">
<div class="accordion">
<div class="accordion-group">
<div class="accordion-heading">
<div class="btn-toolbar">
<h4 class="title">
<a href="#collapseOne" data-parent="#accordion1" data-toggle="collapse" class="accordion-toggle">
<i class="icon-chevron-down"></i><span>Intro Screen</span></a>
</h4>
<input type="checkbox" checked="" style="margin-right:10px;" value="1" name="quiz[status]" class="pull-right">
</div>
</div>
<input type="hidden" id="quizidMain" name="quizid" value="100">
<div class="accordion-body collapse in" id="collapseOne">
<div class="accordion-inner">
<div id="firstform" class="form-horizontal">
<div class="control-group">
<label class="control-label">
<p><b>Header</b></p>
</label>
<div class="controls">
<input type="text" value="Welcome" name="quiz[intro_label]" class="pull-left">
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Intro Text</b></p>
</label>
<div class="controls">
<textarea rows="3" name="quiz[intro]">Welcome to our quiz! To navigate through the quiz questions,simply use your finger and swipe horizontally. Good luck!</textarea>
</div>
</div>
<div id="controlgroup1" class="control-group cf">
<label class="control-label">
<p><b>Custom Field 1</b></p>
</label>
<div class="controls">
<input type="text" value="Name (optional)" name="quiz[customfields][customfield1][text][187]" class="pull-left">
<input type="checkbox" checked="checked" value="1" name="quiz[customfields][customfield1][mandatory][187]">Mandatory
</div>
</div>
<div id="controlgroup2" class="control-group cf">
<label class="control-label">
<p><b>Custom Field 2</b></p>
</label>
<div class="controls">
<input type="text" value="email" name="quiz[customfields][customfield2][text][188]" class="pull-left">
<input type="checkbox" checked="checked" value="2" name="quiz[customfields][customfield2][mandatory][188]">Mandatory
</div>
</div>
<div class="control-group">
<div class="controls">
<button class="btn btn-default addCustomField" type="button">Add Field</button>
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Start Button</b></p>
</label>
<div class="controls">
<input type="text" value="Start" name="quiz[start_quiz_label]" class="pull-left">
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Mandatory Field Message</b></p>
</label>
<div class="controls">
<input type="text" value="Please fill in the mandatory fields!" name="quiz[mandatory_field_msg]" class="pull-left">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="SaveNext" name="SaveNext" value="">
<div class="row-fluid">
<div class="span12">
<div id="answers_questions_form" class="form-horizontal">
<div class="questionwrapper423 formx" id="QBlock423">
<div id="ResponseFlashMessage423"> </div>
<div class="accordion">
<div class="accordion-group">
<div class="accordion-heading">
<div class="btn-toolbar">
<h4 class="title">
<a href="#collapseQ1" data-parent="#answers_questions_form" data-toggle="collapse" class="accordion-toggle">
<i class="icon-chevron-down"></i> <span class="editable_question">What is Zero ?</span></a>
</h4>
<select id="1qt" class="question_type">
<option selected="" value="1">Single Answer</option>
<option value="2">Multiple Answer</option>
<option value="3">Open Ended</option>
<option value="5">tijd type</option>
<option value="7">Matrix (slider)</option>
</select>
<select class="questionnr">
<option selected="" value="1">Q1</option>
<option value="2">Q2</option>
</select>
<div class="btn-group">
<a class="btn CopyQuestion" id="423" href="#"><i class="icon-plus-sign"></i>COPY</a>
<a class="btn SaveQuestion" id="423" href="#"><i class="icon-ok"></i>SAVE</a>
<a class="btn DeleteQuestion" id="423" href="#"><i class="icon-trash"></i></a>
</div>
</div>
</div>
<div class="accordion-body collapse in" id="collapseQ1">
<div class="accordion-inner">
<div class="control-group">
<label class="control-label">
<p><b>Media File</b></p>
</label>
<div class="controls">
<img width="150px" height="auto" alt="media img" src="https://s3.amazonaws.com/surveyanyplace/questionmedia/100_423">
<br>
<span class="btn btn-default btn-file">
<span class="fileupload-new">Select file</span>
<input type="file" multiple="multiple" name="file" id="423" class="margin-none valid"></span>
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Question</b></p>
</label>
<div class="controls">
<input type="text" style="width:500px" class="question" value="What is Zero ?" name="questions[question1][q]" autocomplete="off" required="">
</div>
</div>
<div id="AnswerBlock1qt" class="control-group ">
<label class="control-label">
<p><b>Answers</b></p>
</label><br clear="all">
<div class="controls answerswrapper1">
<div id="1476" class="input-appendX ">
<input type="text" style="width:550px" name="questions[question1][answers][1476]" value="" id="I1476" class="answer" autocomplete="off">
<button id="1" class="btn answerbtn saveAnswer">
<i class="icon-ok-sign correct"></i>
</button>
<button id="1" class="btn answerbtn removeAnswer">
<i class="icon-remove "></i>
</button>
</div>
<div id="1477" class="input-appendX ">
<input type="text" style="width:550px" name="questions[question1][answers][1477]" value="number" id="I1477" class="answer" autocomplete="off">
<button id="1" class="btn answerbtn saveAnswer">
<i class="icon-ok-sign correct"></i>
</button>
<button id="1" class="btn answerbtn removeAnswer">
<i class="icon-remove "></i>
</button>
</div>
<div id="1478" class="input-appendX ">
<input type="text" style="width:550px" name="questions[question1][answers][1478]" value="symbol" id="I1478" class="answer" autocomplete="off">
<button id="1" class="btn answerbtn saveAnswer">
<i class="icon-ok-sign correct"></i>
</button>
<button id="1" class="btn answerbtn removeAnswer">
<i class="icon-remove "></i>
</button>
</div>
</div>
<br>
<button class="btn addAnswer" id="1">Add Answer</button>
</div>
<input type="hidden" class="correctanswerq1" name="questions[question1][correctanswerid]">
<input type="hidden" class="questionid1" name="questions[question1][questionid]" id="questionid1" value="423">
<input type="hidden" class="questiontypeid1" name="questions[question1][questiontypeid]" value="1">
<input type="hidden" class="questionidX1" name="questionid" id="questionidX1" value="423">
<input type="hidden" name="quizid" value="100">
<input type="hidden" name="filename" value="100_423">
<input type="hidden" id="what423" name="what" value="1">
<input type="hidden" id="qustionnumber1" name="qustionnumber" value="1">
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="quizid" value="100">
<div class="row-fluid">
<div id="accordioncontainer" class="span12">
<div class="accordion">
<div class="accordion-group">
<div class="accordion-heading">
<div class="btn-toolbar">
<h4 class="title">
<a href="#collapseOne" data-parent="#accordion1" data-toggle="collapse" class="accordion-toggle">
<i class="icon-chevron-down"></i><span>Outro Screen</span></a>
</h4>
</div>
</div>
<div class="accordion-body collapse in" id="collapseOne">
<div class="accordion-inner form-horizontal">
<div class="control-group">
<label class="control-label">
<p><b>Header</b></p>
</label>
<div class="controls">
<input type="text" value="Thank you !" name="header" class="pull-left">
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Text</b></p>
</label>
<div class="controls">
<textarea name="text" class="pull-left" rows="5">Thank you for completing our survey!</textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Additional Text</b></p>
</label>
<div class="controls">
<textarea name="additional_text" class="pull-left" rows="5"></textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Redirect to</b></p>
</label>
<div class="controls">
<input type="text" value="" name="redirect_to" class="pull-left">
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>View Answers</b></p>
</label>
<div class="controls">
<input type="text" value="View Correct Answers" name="view_answers" class="pull-left">
</div>
</div>
<div class="control-group">
<label class="control-label">
<p><b>Auto-redirect after 10</b></p>
</label>
<div class="controls">
<input type="checkbox" value="1" name="auto_redirect_after_10" class="pull-left">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<script>
$( ".margin-none" ).change(function() {
// UPLOAD Quiz Files
$('#quizform').transloadit({
wait: true,
processZeroFiles: true,
triggerUploadOnFileSelection: true,
params: {
auth: { key: "xxxxxxxxxxxxx" },
template_id: "xxxxxxxxxxxxxxxxxxxxx"
},
fields : true,
onSuccess : function(assembly){
console.log("Success",assembly);
// force post
//document.forms['uPortraitLandscapeForm'].submit();
},
onError : function(assembly){
console.log("Error",assembly);
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.